@hanzo/event 0.3.41 → 0.3.42

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/dist/react.cjs CHANGED
@@ -249,11 +249,17 @@ var RE_CREDENTIAL_PARAM = new RegExp(
249
249
  function redactCredentialParams(s) {
250
250
  return s.replace(RE_CREDENTIAL_PARAM, (_m, prefix) => prefix + REDACTED);
251
251
  }
252
+ var RE_SECRET43 = /(^|[^A-Za-z0-9_-]|%[0-9A-Fa-f]{2})((?=[A-Za-z0-9_-]{0,42}[a-z])(?=[A-Za-z0-9_-]{0,42}[A-Z])[A-Za-z0-9_-]{43})(?![A-Za-z0-9_-])/g;
252
253
  function redactSecrets(s) {
253
254
  s = redactCredentialParams(s);
254
255
  for (const re of SECRET_PATTERNS) s = s.replace(re, REDACTED);
256
+ s = s.replace(RE_SECRET43, (_m, lead) => lead + REDACTED);
255
257
  return redactPAN(s);
256
258
  }
259
+ function withoutFragment(url) {
260
+ const at = url.indexOf("#");
261
+ return at < 0 ? url : url.slice(0, at);
262
+ }
257
263
  function scrubPII(s) {
258
264
  s = s.replace(RE_EMAIL, EMAIL_MARK);
259
265
  s = s.replace(RE_IPV6, IP_MARK);
@@ -382,7 +388,7 @@ function hzAnonId() {
382
388
  }
383
389
 
384
390
  // package.json
385
- var version = "0.3.41";
391
+ var version = "0.3.42";
386
392
 
387
393
  // src/version.ts
388
394
  var VERSION = version;
@@ -1104,9 +1110,9 @@ var Analytics = class {
1104
1110
  ...extra
1105
1111
  };
1106
1112
  const capturePII = this.cfg.capturePII ?? false;
1107
- if (wire.url) wire.url = scrubText(wire.url, capturePII);
1108
- if (wire.path) wire.path = scrubText(wire.path, capturePII);
1109
- if (wire.referrer) wire.referrer = scrubText(wire.referrer, capturePII);
1113
+ if (wire.url) wire.url = scrubText(withoutFragment(wire.url), capturePII);
1114
+ if (wire.path) wire.path = scrubText(withoutFragment(wire.path), capturePII);
1115
+ if (wire.referrer) wire.referrer = scrubText(withoutFragment(wire.referrer), capturePII);
1110
1116
  return wire;
1111
1117
  }
1112
1118
  schedule() {