@chainsafe/lodestar-utils
Advanced tools
Comparing version 0.21.0 to 0.22.0
@@ -12,9 +12,11 @@ "use strict"; | ||
function formatEpochSlotTime(opts, now = Date.now()) { | ||
const secSinceGenesis = now / 1000 - opts.genesisTime; | ||
const slot = Math.floor(secSinceGenesis / opts.secondsPerSlot); | ||
const epoch = Math.floor(slot / opts.slotsPerEpoch); | ||
const slotIndex = slot % opts.slotsPerEpoch; | ||
const slotSec = secSinceGenesis % opts.secondsPerSlot; | ||
const nowSec = now / 1000; | ||
const secSinceGenesis = nowSec - opts.genesisTime; | ||
const epoch = Math.floor(secSinceGenesis / (opts.slotsPerEpoch * opts.secondsPerSlot)); | ||
const epochStartSec = opts.genesisTime + epoch * opts.slotsPerEpoch * opts.secondsPerSlot; | ||
const secSinceStartEpoch = nowSec - epochStartSec; | ||
const slotIndex = Math.floor(secSinceStartEpoch / opts.secondsPerSlot); | ||
const slotSec = secSinceStartEpoch % opts.secondsPerSlot; | ||
return "Eph ".concat(epoch, "/").concat(slotIndex, " ").concat(slotSec.toFixed(3)); | ||
} | ||
//# sourceMappingURL=util.js.map |
@@ -1,2 +0,2 @@ | ||
export declare function isPlainObject(o: any): boolean; | ||
export declare function isPlainObject(o: unknown): boolean; | ||
/** | ||
@@ -3,0 +3,0 @@ * Creates an object with the same keys as object and values generated by running each own enumerable |
@@ -19,5 +19,4 @@ "use strict"; | ||
return val != null && typeof val === "object" && Array.isArray(val) === false; | ||
} // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} | ||
function isPlainObject(o) { | ||
@@ -24,0 +23,0 @@ if (isObjectObject(o) === false) return false; // If has modified constructor |
export declare function loadYaml(yaml: string): Record<string, unknown>; | ||
export declare function dumpYaml(yaml: any): string; | ||
export declare function dumpYaml(yaml: unknown): string; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -19,5 +19,4 @@ "use strict"; | ||
})); | ||
} // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} | ||
function dumpYaml(yaml) { | ||
@@ -24,0 +23,0 @@ return (0, _jsYaml.dump)(yaml, { |
@@ -172,4 +172,6 @@ "use strict"; | ||
instanceOf: BigInt, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
represent: { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -179,2 +181,3 @@ binary: function (obj) { | ||
}, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -184,2 +187,3 @@ octal: function (obj) { | ||
}, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -189,2 +193,3 @@ decimal: function (obj) { | ||
}, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -191,0 +196,0 @@ hexadecimal: function (obj) { |
@@ -22,5 +22,9 @@ "use strict"; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -27,0 +31,0 @@ const schema = new _jsYaml.Schema({ |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.21.0", | ||
"version": "0.22.0", | ||
"main": "lib/index.js", | ||
@@ -40,3 +40,3 @@ "files": [ | ||
"dependencies": { | ||
"@chainsafe/ssz": "^0.8.4", | ||
"@chainsafe/ssz": "^0.8.5", | ||
"abort-controller": "^3.0.0", | ||
@@ -62,3 +62,3 @@ "any-signal": "2.1.1", | ||
], | ||
"gitHead": "58d4adda54d0b87f57c02af91345f0c2818816b9" | ||
"gitHead": "c37afddf34e0459c9c2991c8902ea14c9a947fc0" | ||
} |
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
138287
1624
Updated@chainsafe/ssz@^0.8.5