builder-util-runtime
Advanced tools
Comparing version 3.5.0 to 4.0.0
@@ -46,2 +46,8 @@ "use strict"; | ||
var _index; | ||
function _load_index() { | ||
return _index = require("./index"); | ||
} | ||
var _ProgressCallbackTransform; | ||
@@ -251,6 +257,6 @@ | ||
if (this._actual == null) { | ||
throw new Error("Not finished yet"); | ||
throw (0, (_index || _load_index()).newError)("Not finished yet", "ERR_STREAM_NOT_FINISHED"); | ||
} | ||
if (this._actual !== this.expected) { | ||
throw new Error(`${this.algorithm} checksum mismatch, expected ${this.expected}, got ${this._actual}`); | ||
throw (0, (_index || _load_index()).newError)(`${this.algorithm} checksum mismatch, expected ${this.expected}, got ${this._actual}`, "ERR_CHECKSUM_MISMATCH"); | ||
} | ||
@@ -257,0 +263,0 @@ return null; |
@@ -10,1 +10,2 @@ export { CancellationToken, CancellationError } from "./CancellationToken"; | ||
export declare function asArray<T>(v: null | undefined | T | Array<T>): Array<T>; | ||
export declare function newError(message: string, code: string): Error; |
@@ -164,2 +164,3 @@ "use strict"; | ||
exports.asArray = asArray; | ||
exports.newError = newError; | ||
function asArray(v) { | ||
@@ -174,2 +175,7 @@ if (v == null) { | ||
} | ||
function newError(message, code) { | ||
const error = new Error(message); | ||
error.code = code; | ||
return error; | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -14,2 +14,8 @@ "use strict"; | ||
var _index; | ||
function _load_index() { | ||
return _index = require("./index"); | ||
} | ||
const invalidName = "options.name must be either a string or a Buffer"; | ||
@@ -105,3 +111,3 @@ const moreThan10000 = "can not generate more than 10000 UUIDs per second"; | ||
} | ||
throw new Error("Unknown type of uuid"); | ||
throw (0, (_index || _load_index()).newError)("Unknown type of uuid", "ERR_UNKNOWN_UUID_TYPE"); | ||
} | ||
@@ -209,3 +215,3 @@ // read stringified uuid into a Buffer | ||
if (nameIsNotAString && !Buffer.isBuffer(name)) { | ||
throw new Error(invalidName); | ||
throw (0, (_index || _load_index()).newError)(invalidName, "ERR_INVALID_UUID_NAME"); | ||
} | ||
@@ -212,0 +218,0 @@ hash.update(namespace); |
@@ -15,2 +15,8 @@ "use strict"; | ||
var _index; | ||
function _load_index() { | ||
return _index = require("./index"); | ||
} | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
@@ -26,6 +32,6 @@ | ||
if (!name) { | ||
throw new Error("Element name cannot be empty"); | ||
throw (0, (_index || _load_index()).newError)("Element name cannot be empty", "ERR_XML_ELEMENT_NAME_EMPTY"); | ||
} | ||
if (!isValidName(name)) { | ||
throw new Error(`Invalid element name: ${name}`); | ||
throw (0, (_index || _load_index()).newError)(`Invalid element name: ${name}`, "ERR_XML_ELEMENT_INVALID_NAME"); | ||
} | ||
@@ -36,3 +42,3 @@ } | ||
if (result == null) { | ||
throw new Error(`No attribute "${name}"`); | ||
throw (0, (_index || _load_index()).newError)(`No attribute "${name}"`, "ERR_XML_MISSED_ATTRIBUTE"); | ||
} | ||
@@ -49,3 +55,3 @@ return result; | ||
if (result === null) { | ||
throw new Error(errorIfMissed || `No element "${name}"`); | ||
throw (0, (_index || _load_index()).newError)(errorIfMissed || `No element "${name}"`, "ERR_XML_MISSED_ELEMENT"); | ||
} | ||
@@ -52,0 +58,0 @@ return result; |
{ | ||
"name": "builder-util-runtime", | ||
"version": "3.5.0", | ||
"version": "4.0.0", | ||
"main": "out/index.js", | ||
@@ -5,0 +5,0 @@ "author": "Vladimir Krivosheev", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
151714
1684