@uniformdev/redirect
Advanced tools
Comparing version 19.165.2-alpha.0 to 19.166.1
@@ -113,4 +113,3 @@ "use strict"; | ||
var _a; | ||
if (!data) | ||
return; | ||
if (!data) return; | ||
const setCache = () => { | ||
@@ -192,4 +191,3 @@ _WithMemoryCache.trieCache[key] = { | ||
const segment = segments[i]; | ||
if (i === 0 && segment === "") | ||
continue; | ||
if (i === 0 && segment === "") continue; | ||
if (!Object.hasOwn(cur, segment)) { | ||
@@ -234,4 +232,3 @@ cur[segment] = new PathTrieData(); | ||
} | ||
if (!wildcard || wildcard.active) | ||
return void 0; | ||
if (!wildcard || wildcard.active) return void 0; | ||
wildcard.active = true; | ||
@@ -277,4 +274,3 @@ cur = wildcard == null ? void 0 : wildcard.startTrie; | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
@@ -285,7 +281,5 @@ } | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
if (ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
continue; | ||
@@ -295,8 +289,6 @@ } | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
} | ||
if (ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
} | ||
@@ -377,4 +369,3 @@ return [...ret, ...splats]; | ||
const merged = new URLSearchParams([...params1, ...params2]).toString(); | ||
if (merged.length > 0) | ||
return (fragment ? "#" : "?") + merged; | ||
if (merged.length > 0) return (fragment ? "#" : "?") + merged; | ||
return ""; | ||
@@ -410,4 +401,3 @@ } | ||
const result = await cachePromise; | ||
if (result) | ||
return result; | ||
if (result) return result; | ||
} | ||
@@ -480,4 +470,3 @@ const ret = this.assembleTrie(); | ||
const redirect = (_a = redirects == null ? void 0 : redirects.redirects) == null ? void 0 : _a[0]; | ||
if (!redirect) | ||
return void 0; | ||
if (!redirect) return void 0; | ||
return _RedirectClient.processDefinitionToResults( | ||
@@ -585,4 +574,3 @@ processedUrl, | ||
var _a; | ||
if (!id || !result.lastHop) | ||
return false; | ||
if (!id || !result.lastHop) return false; | ||
const set = /* @__PURE__ */ new Set([id]); | ||
@@ -593,6 +581,4 @@ const cycleStack = [result]; | ||
const redirect = (_a = cur == null ? void 0 : cur.definition) == null ? void 0 : _a.redirect; | ||
if (!(redirect == null ? void 0 : redirect.id)) | ||
continue; | ||
if (set.has(redirect.id)) | ||
return true; | ||
if (!(redirect == null ? void 0 : redirect.id)) continue; | ||
if (set.has(redirect.id)) return true; | ||
set.add(redirect.id); | ||
@@ -609,4 +595,3 @@ if (cur == null ? void 0 : cur.lastHop) { | ||
const result = stack.pop(); | ||
if (!(result == null ? void 0 : result.url)) | ||
continue; | ||
if (!(result == null ? void 0 : result.url)) continue; | ||
const hop = this.processHop(result == null ? void 0 : result.url, trie, bestMatch, options).filter( | ||
@@ -650,4 +635,3 @@ (h) => { | ||
const redirect = definition == null ? void 0 : definition.redirect; | ||
if (redirect.sourceMustMatchDomain && processedUrl.domain !== processedResult.domain) | ||
return void 0; | ||
if (redirect.sourceMustMatchDomain && processedUrl.domain !== processedResult.domain) return void 0; | ||
const finalUrl = (options == null ? void 0 : options.reverse) ? "n/a" : getTargetVariableExpandedUrl(processedUrl.url, redirect); | ||
@@ -667,4 +651,3 @@ return { | ||
return false; | ||
if (processedSource.query && !processedUrl.query) | ||
return false; | ||
if (processedSource.query && !processedUrl.query) return false; | ||
if (processedSource.query && processedUrl.query) { | ||
@@ -674,4 +657,3 @@ const sourceqs = new URLSearchParams(processedSource.query); | ||
for (const [key] of sourceqs) { | ||
if (!urlqs.has(key) || urlqs.get(key) !== sourceqs.get(key)) | ||
return false; | ||
if (!urlqs.has(key) || urlqs.get(key) !== sourceqs.get(key)) return false; | ||
} | ||
@@ -678,0 +660,0 @@ } |
@@ -67,4 +67,3 @@ // src/cache/data/refresher.ts | ||
var _a; | ||
if (!data) | ||
return; | ||
if (!data) return; | ||
const setCache = () => { | ||
@@ -146,4 +145,3 @@ _WithMemoryCache.trieCache[key] = { | ||
const segment = segments[i]; | ||
if (i === 0 && segment === "") | ||
continue; | ||
if (i === 0 && segment === "") continue; | ||
if (!Object.hasOwn(cur, segment)) { | ||
@@ -188,4 +186,3 @@ cur[segment] = new PathTrieData(); | ||
} | ||
if (!wildcard || wildcard.active) | ||
return void 0; | ||
if (!wildcard || wildcard.active) return void 0; | ||
wildcard.active = true; | ||
@@ -231,4 +228,3 @@ cur = wildcard == null ? void 0 : wildcard.startTrie; | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
@@ -239,7 +235,5 @@ } | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
if (ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
continue; | ||
@@ -249,8 +243,6 @@ } | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
} | ||
if (ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
} | ||
@@ -331,4 +323,3 @@ return [...ret, ...splats]; | ||
const merged = new URLSearchParams([...params1, ...params2]).toString(); | ||
if (merged.length > 0) | ||
return (fragment ? "#" : "?") + merged; | ||
if (merged.length > 0) return (fragment ? "#" : "?") + merged; | ||
return ""; | ||
@@ -364,4 +355,3 @@ } | ||
const result = await cachePromise; | ||
if (result) | ||
return result; | ||
if (result) return result; | ||
} | ||
@@ -434,4 +424,3 @@ const ret = this.assembleTrie(); | ||
const redirect = (_a = redirects == null ? void 0 : redirects.redirects) == null ? void 0 : _a[0]; | ||
if (!redirect) | ||
return void 0; | ||
if (!redirect) return void 0; | ||
return _RedirectClient.processDefinitionToResults( | ||
@@ -539,4 +528,3 @@ processedUrl, | ||
var _a; | ||
if (!id || !result.lastHop) | ||
return false; | ||
if (!id || !result.lastHop) return false; | ||
const set = /* @__PURE__ */ new Set([id]); | ||
@@ -547,6 +535,4 @@ const cycleStack = [result]; | ||
const redirect = (_a = cur == null ? void 0 : cur.definition) == null ? void 0 : _a.redirect; | ||
if (!(redirect == null ? void 0 : redirect.id)) | ||
continue; | ||
if (set.has(redirect.id)) | ||
return true; | ||
if (!(redirect == null ? void 0 : redirect.id)) continue; | ||
if (set.has(redirect.id)) return true; | ||
set.add(redirect.id); | ||
@@ -563,4 +549,3 @@ if (cur == null ? void 0 : cur.lastHop) { | ||
const result = stack.pop(); | ||
if (!(result == null ? void 0 : result.url)) | ||
continue; | ||
if (!(result == null ? void 0 : result.url)) continue; | ||
const hop = this.processHop(result == null ? void 0 : result.url, trie, bestMatch, options).filter( | ||
@@ -604,4 +589,3 @@ (h) => { | ||
const redirect = definition == null ? void 0 : definition.redirect; | ||
if (redirect.sourceMustMatchDomain && processedUrl.domain !== processedResult.domain) | ||
return void 0; | ||
if (redirect.sourceMustMatchDomain && processedUrl.domain !== processedResult.domain) return void 0; | ||
const finalUrl = (options == null ? void 0 : options.reverse) ? "n/a" : getTargetVariableExpandedUrl(processedUrl.url, redirect); | ||
@@ -621,4 +605,3 @@ return { | ||
return false; | ||
if (processedSource.query && !processedUrl.query) | ||
return false; | ||
if (processedSource.query && !processedUrl.query) return false; | ||
if (processedSource.query && processedUrl.query) { | ||
@@ -628,4 +611,3 @@ const sourceqs = new URLSearchParams(processedSource.query); | ||
for (const [key] of sourceqs) { | ||
if (!urlqs.has(key) || urlqs.get(key) !== sourceqs.get(key)) | ||
return false; | ||
if (!urlqs.has(key) || urlqs.get(key) !== sourceqs.get(key)) return false; | ||
} | ||
@@ -632,0 +614,0 @@ } |
@@ -113,4 +113,3 @@ "use strict"; | ||
var _a; | ||
if (!data) | ||
return; | ||
if (!data) return; | ||
const setCache = () => { | ||
@@ -192,4 +191,3 @@ _WithMemoryCache.trieCache[key] = { | ||
const segment = segments[i]; | ||
if (i === 0 && segment === "") | ||
continue; | ||
if (i === 0 && segment === "") continue; | ||
if (!Object.hasOwn(cur, segment)) { | ||
@@ -234,4 +232,3 @@ cur[segment] = new PathTrieData(); | ||
} | ||
if (!wildcard || wildcard.active) | ||
return void 0; | ||
if (!wildcard || wildcard.active) return void 0; | ||
wildcard.active = true; | ||
@@ -277,4 +274,3 @@ cur = wildcard == null ? void 0 : wildcard.startTrie; | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
@@ -285,7 +281,5 @@ } | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
if (ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
continue; | ||
@@ -295,8 +289,6 @@ } | ||
const more = scanWildcards(); | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (typeof more === "undefined" || ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
i = more; | ||
} | ||
if (ret.length > 0 && bestMatch) | ||
return [...ret, ...splats]; | ||
if (ret.length > 0 && bestMatch) return [...ret, ...splats]; | ||
} | ||
@@ -377,4 +369,3 @@ return [...ret, ...splats]; | ||
const merged = new URLSearchParams([...params1, ...params2]).toString(); | ||
if (merged.length > 0) | ||
return (fragment ? "#" : "?") + merged; | ||
if (merged.length > 0) return (fragment ? "#" : "?") + merged; | ||
return ""; | ||
@@ -410,4 +401,3 @@ } | ||
const result = await cachePromise; | ||
if (result) | ||
return result; | ||
if (result) return result; | ||
} | ||
@@ -480,4 +470,3 @@ const ret = this.assembleTrie(); | ||
const redirect = (_a = redirects == null ? void 0 : redirects.redirects) == null ? void 0 : _a[0]; | ||
if (!redirect) | ||
return void 0; | ||
if (!redirect) return void 0; | ||
return _RedirectClient.processDefinitionToResults( | ||
@@ -585,4 +574,3 @@ processedUrl, | ||
var _a; | ||
if (!id || !result.lastHop) | ||
return false; | ||
if (!id || !result.lastHop) return false; | ||
const set = /* @__PURE__ */ new Set([id]); | ||
@@ -593,6 +581,4 @@ const cycleStack = [result]; | ||
const redirect = (_a = cur == null ? void 0 : cur.definition) == null ? void 0 : _a.redirect; | ||
if (!(redirect == null ? void 0 : redirect.id)) | ||
continue; | ||
if (set.has(redirect.id)) | ||
return true; | ||
if (!(redirect == null ? void 0 : redirect.id)) continue; | ||
if (set.has(redirect.id)) return true; | ||
set.add(redirect.id); | ||
@@ -609,4 +595,3 @@ if (cur == null ? void 0 : cur.lastHop) { | ||
const result = stack.pop(); | ||
if (!(result == null ? void 0 : result.url)) | ||
continue; | ||
if (!(result == null ? void 0 : result.url)) continue; | ||
const hop = this.processHop(result == null ? void 0 : result.url, trie, bestMatch, options).filter( | ||
@@ -650,4 +635,3 @@ (h) => { | ||
const redirect = definition == null ? void 0 : definition.redirect; | ||
if (redirect.sourceMustMatchDomain && processedUrl.domain !== processedResult.domain) | ||
return void 0; | ||
if (redirect.sourceMustMatchDomain && processedUrl.domain !== processedResult.domain) return void 0; | ||
const finalUrl = (options == null ? void 0 : options.reverse) ? "n/a" : getTargetVariableExpandedUrl(processedUrl.url, redirect); | ||
@@ -667,4 +651,3 @@ return { | ||
return false; | ||
if (processedSource.query && !processedUrl.query) | ||
return false; | ||
if (processedSource.query && !processedUrl.query) return false; | ||
if (processedSource.query && processedUrl.query) { | ||
@@ -674,4 +657,3 @@ const sourceqs = new URLSearchParams(processedSource.query); | ||
for (const [key] of sourceqs) { | ||
if (!urlqs.has(key) || urlqs.get(key) !== sourceqs.get(key)) | ||
return false; | ||
if (!urlqs.has(key) || urlqs.get(key) !== sourceqs.get(key)) return false; | ||
} | ||
@@ -678,0 +660,0 @@ } |
{ | ||
"name": "@uniformdev/redirect", | ||
"version": "19.165.2-alpha.0+323887559d", | ||
"version": "19.166.1", | ||
"description": "Uniform redirect client", | ||
@@ -36,3 +36,3 @@ "license": "SEE LICENSE IN LICENSE.txt", | ||
"dependencies": { | ||
"@uniformdev/context": "19.165.2-alpha.0+323887559d", | ||
"@uniformdev/context": "19.166.1", | ||
"p-limit": "^3.1.0", | ||
@@ -44,3 +44,3 @@ "rfdc": "^1.3.0" | ||
}, | ||
"gitHead": "323887559d1bdc7432f91d305afaec90b98f660f" | ||
"gitHead": "d6a92d76bb91fa41a51cf27a69d81e0cc985f80f" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
0
151071
3310
+ Added@uniformdev/context@19.166.1(transitive)
+ Addeddequal@2.0.3(transitive)
+ Addedjs-cookie@3.0.5(transitive)
+ Addedmitt@3.0.1(transitive)
+ Addeduuid@9.0.1(transitive)
Updated@uniformdev/context@19.166.1