@lodestar/utils 1.13.0-dev.fa702dfeb0 → 1.13.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/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export * from "./sleep.js";
15
15
  export * from "./sort.js";
16
16
  export * from "./timeout.js";
17
17
  export { type RecursivePartial, bnToNum } from "./types.js";
18
- export * from "./validation.js";
18
+ export * from "./url.js";
19
19
  export * from "./verifyMerkleBranch.js";
20
20
  export * from "./promise.js";
21
21
  export * from "./waitFor.js";
package/lib/index.js CHANGED
@@ -15,7 +15,7 @@ export * from "./sleep.js";
15
15
  export * from "./sort.js";
16
16
  export * from "./timeout.js";
17
17
  export { bnToNum } from "./types.js";
18
- export * from "./validation.js";
18
+ export * from "./url.js";
19
19
  export * from "./verifyMerkleBranch.js";
20
20
  export * from "./promise.js";
21
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,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,EAAoB,MAAM,YAAY,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAwB,OAAO,EAAC,MAAM,YAAY,CAAC;AAC1D,cAAc,iBAAiB,CAAC;AAChC,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,EAAoB,MAAM,YAAY,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAwB,OAAO,EAAC,MAAM,YAAY,CAAC;AAC1D,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
package/lib/url.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export declare function isValidHttpUrl(urlStr: string): boolean;
2
+ /**
3
+ * Sanitize URL to prevent leaking user credentials in logs
4
+ *
5
+ * Note: `urlStr` must be a valid URL
6
+ */
7
+ export declare function toSafePrintableUrl(urlStr: string): string;
8
+ //# sourceMappingURL=url.d.ts.map
@@ -17,4 +17,12 @@ export function isValidHttpUrl(urlStr) {
17
17
  }
18
18
  return url.protocol === "http:" || url.protocol === "https:";
19
19
  }
20
- //# sourceMappingURL=validation.js.map
20
+ /**
21
+ * Sanitize URL to prevent leaking user credentials in logs
22
+ *
23
+ * Note: `urlStr` must be a valid URL
24
+ */
25
+ export function toSafePrintableUrl(urlStr) {
26
+ return new URL(urlStr).origin;
27
+ }
28
+ //# sourceMappingURL=url.js.map
package/lib/url.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../src/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,GAAG,CAAC;IACR,IAAI;QACF,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QAEtB,gFAAgF;QAChF,6EAA6E;QAC7E,6EAA6E;QAC7E,EAAE;QACF,4EAA4E;QAC5E,EAAE;QACF,kFAAkF;QAClF,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;KAClC;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;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;AAChC,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.13.0-dev.fa702dfeb0",
14
+ "version": "1.13.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": "5d700ce520fa0c9627f13d12ad4a6c0acdbd876d"
58
+ "gitHead": "85272e1c2061251617465232f9173ddd171c1d6b"
59
59
  }
@@ -1,2 +0,0 @@
1
- export declare function isValidHttpUrl(urlStr: string): boolean;
2
- //# sourceMappingURL=validation.d.ts.map
@@ -1 +0,0 @@
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;QAEtB,gFAAgF;QAChF,6EAA6E;QAC7E,6EAA6E;QAC7E,EAAE;QACF,4EAA4E;QAC5E,EAAE;QACF,kFAAkF;QAClF,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;KAClC;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"}