@chainsafe/lodestar-utils
Advanced tools
Comparing version 0.22.0 to 0.23.0
@@ -28,3 +28,3 @@ "use strict"; | ||
if (!(actual === expected)) { | ||
throw new AssertionError("".concat(message || "Expected values to be equal", ": ").concat(actual, " === ").concat(expected)); | ||
throw new AssertionError(`${message || "Expected values to be equal"}: ${actual} === ${expected}`); | ||
} | ||
@@ -41,3 +41,3 @@ }, | ||
if (!(left <= right)) { | ||
throw new AssertionError("".concat(message || "Expected value to be lte", ": ").concat(left, " <= ").concat(right)); | ||
throw new AssertionError(`${message || "Expected value to be lte"}: ${left} <= ${right}`); | ||
} | ||
@@ -54,3 +54,3 @@ }, | ||
if (!(left < right)) { | ||
throw new AssertionError("".concat(message || "Expected value to be lt", ": ").concat(left, " < ").concat(right)); | ||
throw new AssertionError(`${message || "Expected value to be lt"}: ${left} < ${right}`); | ||
} | ||
@@ -67,3 +67,3 @@ }, | ||
if (!(left >= right)) { | ||
throw new AssertionError("".concat(message || "Expected value to be gte", ": ").concat(left, " >= ").concat(right)); | ||
throw new AssertionError(`${message || "Expected value to be gte"}: ${left} >= ${right}`); | ||
} | ||
@@ -80,3 +80,3 @@ }, | ||
if (!(left > right)) { | ||
throw new AssertionError("".concat(message || "Expected value to be gt", ": ").concat(left, " > ").concat(right)); | ||
throw new AssertionError(`${message || "Expected value to be gt"}: ${left} > ${right}`); | ||
} | ||
@@ -83,0 +83,0 @@ } |
@@ -50,3 +50,3 @@ "use strict"; | ||
constructor(message) { | ||
super("Aborted ".concat(message || "")); | ||
super(`Aborted ${message || ""}`); | ||
} | ||
@@ -64,3 +64,3 @@ | ||
constructor(message) { | ||
super("Timeout ".concat(message || "")); | ||
super(`Timeout ${message || ""}`); | ||
} | ||
@@ -67,0 +67,0 @@ |
@@ -16,4 +16,4 @@ "use strict"; | ||
const str = typeof root === "string" ? root : (0, _ssz.toHexString)(root); | ||
return "".concat(str.slice(0, 6), "\u2026").concat(str.slice(-4)); | ||
return `${str.slice(0, 6)}…${str.slice(-4)}`; | ||
} | ||
//# sourceMappingURL=format.js.map |
@@ -1,2 +0,1 @@ | ||
export * from "./events"; | ||
export * from "./logger"; | ||
@@ -3,0 +2,0 @@ export * from "./yaml"; |
@@ -7,15 +7,2 @@ "use strict"; | ||
var _events = require("./events"); | ||
Object.keys(_events).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _events[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _events[key]; | ||
} | ||
}); | ||
}); | ||
var _logger = require("./logger"); | ||
@@ -22,0 +9,0 @@ |
@@ -63,3 +63,3 @@ "use strict"; | ||
if (Array.isArray(json)) return json.map(item => toString(item, true)).join(", "); | ||
return Object.entries(json).map(([key, value]) => "".concat(key, "=").concat(toString(value, true))).join(", "); | ||
return Object.entries(json).map(([key, value]) => `${key}=${toString(value, true)}`).join(", "); | ||
} | ||
@@ -66,0 +66,0 @@ |
@@ -75,3 +75,3 @@ "use strict"; | ||
const infoPad = paddingBetweenInfo - infoString.length; | ||
const logParts = [info.timestamp, "[".concat(infoString.toUpperCase(), "]"), "".concat(info.level.padStart(infoPad), ":"), info.message, info.context ? printStackTraceLast(info.context) : undefined, info.error ? printStackTraceLast(info.error) : undefined, info.durationMs && " - duration=".concat(info.durationMs, "ms")]; | ||
const logParts = [info.timestamp, `[${infoString.toUpperCase()}]`, `${info.level.padStart(infoPad)}:`, info.message, info.context ? printStackTraceLast(info.context) : undefined, info.error ? printStackTraceLast(info.error) : undefined, info.durationMs && ` - duration=${info.durationMs}ms`]; | ||
return logParts.filter(s => s).join(" "); | ||
@@ -78,0 +78,0 @@ } |
@@ -19,4 +19,4 @@ "use strict"; | ||
const slotSec = secSinceStartEpoch % opts.secondsPerSlot; | ||
return "Eph ".concat(epoch, "/").concat(slotIndex, " ").concat(slotSec.toFixed(3)); | ||
return `Eph ${epoch}/${slotIndex} ${slotSec.toFixed(3)}`; | ||
} | ||
//# sourceMappingURL=util.js.map |
@@ -13,3 +13,3 @@ export declare function isPlainObject(o: unknown): boolean; | ||
}; | ||
export declare function objectToExpectedCase(obj: Record<string, unknown>, expectedCase?: "snake" | "camel"): Record<string, unknown>; | ||
export declare function objectToExpectedCase<T extends Record<string, unknown> | Record<string, unknown>[]>(obj: T, expectedCase?: "snake" | "camel"): T; | ||
//# sourceMappingURL=objects.d.ts.map |
@@ -74,3 +74,3 @@ "use strict"; | ||
if (newName !== name && obj.hasOwnProperty(newName)) { | ||
throw new Error("object already has a ".concat(newName, " property")); | ||
throw new Error(`object already has a ${newName} property`); | ||
} | ||
@@ -77,0 +77,0 @@ |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.22.0", | ||
"version": "0.23.0", | ||
"main": "lib/index.js", | ||
@@ -40,3 +40,3 @@ "files": [ | ||
"dependencies": { | ||
"@chainsafe/ssz": "^0.8.5", | ||
"@chainsafe/ssz": "^0.8.7", | ||
"abort-controller": "^3.0.0", | ||
@@ -46,3 +46,2 @@ "any-signal": "2.1.1", | ||
"chalk": "^2.4.2", | ||
"event-iterator": "^2.0.0", | ||
"js-yaml": "^3.13.1", | ||
@@ -63,3 +62,3 @@ "winston": "^3.3.3", | ||
], | ||
"gitHead": "c37afddf34e0459c9c2991c8902ea14c9a947fc0" | ||
"gitHead": "8f4e720c0ed5b701149e2b432c22f0c2b536555a" | ||
} |
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
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
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
8
133863
72
1559
- Removedevent-iterator@^2.0.0
- Removedevent-iterator@2.0.0(transitive)
Updated@chainsafe/ssz@^0.8.7