@lodestar/utils 1.11.0-dev.f9c71074df → 1.11.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base64.d.ts +3 -0
- package/lib/base64.js +8 -0
- package/lib/base64.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/validation.d.ts +2 -0
- package/lib/validation.js +11 -0
- package/lib/validation.js.map +1 -0
- package/package.json +2 -2
package/lib/base64.d.ts
ADDED
package/lib/base64.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const hasBufferFrom = typeof Buffer !== "undefined" && typeof Buffer.from === "function";
|
|
2
|
+
export function toBase64(value) {
|
|
3
|
+
return hasBufferFrom ? Buffer.from(value).toString("base64") : btoa(value);
|
|
4
|
+
}
|
|
5
|
+
export function fromBase64(value) {
|
|
6
|
+
return hasBufferFrom ? Buffer.from(value, "base64").toString("utf8") : atob(value);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../src/base64.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC;AAEzF,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,OAAO,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrF,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./yaml/index.js";
|
|
2
2
|
export * from "./assert.js";
|
|
3
|
+
export * from "./base64.js";
|
|
3
4
|
export * from "./bytes.js";
|
|
4
5
|
export * from "./err.js";
|
|
5
6
|
export * from "./errors.js";
|
|
@@ -14,6 +15,7 @@ export * from "./sleep.js";
|
|
|
14
15
|
export * from "./sort.js";
|
|
15
16
|
export * from "./timeout.js";
|
|
16
17
|
export { RecursivePartial, bnToNum } from "./types.js";
|
|
18
|
+
export * from "./validation.js";
|
|
17
19
|
export * from "./verifyMerkleBranch.js";
|
|
18
20
|
export * from "./promise.js";
|
|
19
21
|
export * from "./waitFor.js";
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./yaml/index.js";
|
|
2
2
|
export * from "./assert.js";
|
|
3
|
+
export * from "./base64.js";
|
|
3
4
|
export * from "./bytes.js";
|
|
4
5
|
export * from "./err.js";
|
|
5
6
|
export * from "./errors.js";
|
|
@@ -14,6 +15,7 @@ export * from "./sleep.js";
|
|
|
14
15
|
export * from "./sort.js";
|
|
15
16
|
export * from "./timeout.js";
|
|
16
17
|
export { bnToNum } from "./types.js";
|
|
18
|
+
export * from "./validation.js";
|
|
17
19
|
export * from "./verifyMerkleBranch.js";
|
|
18
20
|
export * from "./promise.js";
|
|
19
21
|
export * from "./waitFor.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,KAAK,EAAe,MAAM,YAAY,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAmB,OAAO,EAAC,MAAM,YAAY,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,KAAK,EAAe,MAAM,YAAY,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAmB,OAAO,EAAC,MAAM,YAAY,CAAC;AACrD,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,GAAG,CAAC;IACR,IAAI;QACF,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC/D,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.11.0-
|
|
14
|
+
"version": "1.11.0-rc.0",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": "./lib/index.js",
|
|
17
17
|
"files": [
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"beacon",
|
|
56
56
|
"blockchain"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "b546eec3594fdcf6dd6787edbae499ec68302b0d"
|
|
59
59
|
}
|