@debugbundle/redaction 1.7.0 → 1.7.1

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.
@@ -0,0 +1,2 @@
1
+ export declare function sanitizeBrowserStackUrls(stack: string): string;
2
+ //# sourceMappingURL=browser-stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-stack.d.ts","sourceRoot":"","sources":["../src/browser-stack.ts"],"names":[],"mappings":"AAEA,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa9D"}
@@ -0,0 +1,18 @@
1
+ // Enforce the browser URL privacy boundary for installed SDK versions too.
2
+ // Coordinates are stack syntax, not part of a query or fragment to retain.
3
+ export function sanitizeBrowserStackUrls(stack) {
4
+ return stack.replace(/https?:\/\/[^\s]+/gi, (source) => {
5
+ // Parentheses are legal URL characters, including inside credentials/query.
6
+ // Consume the whole location before separating trailing stack punctuation.
7
+ const suffix = source.match(/:\d+(?::\d+)?[),]*$/)?.[0] ?? source.match(/[),]+$/)?.[0] ?? "";
8
+ const location = suffix.length === 0 ? source : source.slice(0, -suffix.length);
9
+ try {
10
+ const parsed = new URL(location);
11
+ return `${parsed.origin}${parsed.pathname}${suffix}`;
12
+ }
13
+ catch {
14
+ return `[unavailable-url]${suffix}`;
15
+ }
16
+ });
17
+ }
18
+ //# sourceMappingURL=browser-stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-stack.js","sourceRoot":"","sources":["../src/browser-stack.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2EAA2E;AAC3E,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,EAAE,EAAE;QACrD,4EAA4E;QAC5E,2EAA2E;QAC3E,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7F,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChF,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;YACjC,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,GAAG,MAAM,EAAE,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,oBAAoB,MAAM,EAAE,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugbundle/redaction",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",