@uniformdev/redirect 19.14.2-alpha.1 → 19.14.2-alpha.11

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/index.d.ts CHANGED
@@ -15,6 +15,7 @@ declare class PathTrie<T> {
15
15
  insert(path: string, data: T): void;
16
16
  find(path: string, bestMatch?: boolean): pathTrieReturn<T>[] | undefined;
17
17
  private splitUrl;
18
+ private clone;
18
19
  }
19
20
  declare class PathTrieData<T> {
20
21
  [key: string]: PathTrieData<T> | T;
@@ -31,6 +32,7 @@ declare class Trie<T> {
31
32
  variables: string[];
32
33
  }[] | undefined;
33
34
  processChar(char: string): string;
35
+ private clone;
34
36
  }
35
37
  declare class TrieData<T> {
36
38
  [key: string]: TrieData<T> | T;
package/dist/index.esm.js CHANGED
@@ -53,13 +53,7 @@ var WithMemoryCache = _WithMemoryCache;
53
53
  WithMemoryCache.trieCache = {};
54
54
 
55
55
  // src/data/pathTrie.ts
56
- if (!global.structuredClone) {
57
- global.structuredClone = function structuredClone2(objectToClone) {
58
- const stringified = JSON.stringify(objectToClone);
59
- const parsed = JSON.parse(stringified);
60
- return parsed;
61
- };
62
- }
56
+ import rfdc from "rfdc";
63
57
  var dataProp = "~~data~~";
64
58
  var PathTrie = class {
65
59
  constructor(initialData) {
@@ -71,6 +65,7 @@ var PathTrie = class {
71
65
  return ["http://", ...url.substring("http://".length).split("/")].filter((segment) => segment.length);
72
66
  return url.split("/").filter((segment) => segment.length);
73
67
  };
68
+ this.clone = rfdc();
74
69
  if (initialData) {
75
70
  if (Object.hasOwn(initialData, "map")) {
76
71
  this.map = initialData.map;
@@ -113,7 +108,7 @@ var PathTrie = class {
113
108
  }
114
109
  }
115
110
  find(path, bestMatch = true) {
116
- let cur = structuredClone(this.map);
111
+ let cur = this.clone(this.map);
117
112
  const segments = this.splitUrl(path);
118
113
  const wildcards = [];
119
114
  const ret = [];
package/dist/index.js CHANGED
@@ -245,13 +245,7 @@ var WithMemoryCache = _WithMemoryCache;
245
245
  WithMemoryCache.trieCache = {};
246
246
 
247
247
  // src/data/pathTrie.ts
248
- if (!global.structuredClone) {
249
- global.structuredClone = function structuredClone2(objectToClone) {
250
- const stringified = JSON.stringify(objectToClone);
251
- const parsed = JSON.parse(stringified);
252
- return parsed;
253
- };
254
- }
248
+ var import_rfdc = __toESM(require("rfdc"));
255
249
  var dataProp = "~~data~~";
256
250
  var PathTrie = class {
257
251
  constructor(initialData) {
@@ -263,6 +257,7 @@ var PathTrie = class {
263
257
  return ["http://", ...url.substring("http://".length).split("/")].filter((segment) => segment.length);
264
258
  return url.split("/").filter((segment) => segment.length);
265
259
  };
260
+ this.clone = (0, import_rfdc.default)();
266
261
  if (initialData) {
267
262
  if (Object.hasOwn(initialData, "map")) {
268
263
  this.map = initialData.map;
@@ -305,7 +300,7 @@ var PathTrie = class {
305
300
  }
306
301
  }
307
302
  find(path, bestMatch = true) {
308
- let cur = structuredClone(this.map);
303
+ let cur = this.clone(this.map);
309
304
  const segments = this.splitUrl(path);
310
305
  const wildcards = [];
311
306
  const ret = [];
package/dist/index.mjs CHANGED
@@ -53,13 +53,7 @@ var WithMemoryCache = _WithMemoryCache;
53
53
  WithMemoryCache.trieCache = {};
54
54
 
55
55
  // src/data/pathTrie.ts
56
- if (!global.structuredClone) {
57
- global.structuredClone = function structuredClone2(objectToClone) {
58
- const stringified = JSON.stringify(objectToClone);
59
- const parsed = JSON.parse(stringified);
60
- return parsed;
61
- };
62
- }
56
+ import rfdc from "rfdc";
63
57
  var dataProp = "~~data~~";
64
58
  var PathTrie = class {
65
59
  constructor(initialData) {
@@ -71,6 +65,7 @@ var PathTrie = class {
71
65
  return ["http://", ...url.substring("http://".length).split("/")].filter((segment) => segment.length);
72
66
  return url.split("/").filter((segment) => segment.length);
73
67
  };
68
+ this.clone = rfdc();
74
69
  if (initialData) {
75
70
  if (Object.hasOwn(initialData, "map")) {
76
71
  this.map = initialData.map;
@@ -113,7 +108,7 @@ var PathTrie = class {
113
108
  }
114
109
  }
115
110
  find(path, bestMatch = true) {
116
- let cur = structuredClone(this.map);
111
+ let cur = this.clone(this.map);
117
112
  const segments = this.splitUrl(path);
118
113
  const wildcards = [];
119
114
  const ret = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/redirect",
3
- "version": "19.14.2-alpha.1+1a0bb3525",
3
+ "version": "19.14.2-alpha.11+79c4dd05d",
4
4
  "description": "Uniform redirect client",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -32,11 +32,12 @@
32
32
  "/dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@uniformdev/context": "19.14.2-alpha.1+1a0bb3525",
36
- "p-limit": "^3.1.0"
35
+ "@uniformdev/context": "19.14.2-alpha.11+79c4dd05d",
36
+ "p-limit": "^3.1.0",
37
+ "rfdc": "^1.3.0"
37
38
  },
38
39
  "publishConfig": {
39
40
  "access": "public"
40
41
  },
41
- "gitHead": "1a0bb3525e8302e4b294f101812f195c0e5f7f26"
42
+ "gitHead": "79c4dd05dd9fb452762d03812539d5cf0eba44fa"
42
43
  }