Comparing version 7.0.2 to 7.0.3
@@ -645,197 +645,2 @@ "use strict"; | ||
// node_modules/map-or-similar/src/similar.js | ||
var require_similar = __commonJS({ | ||
"node_modules/map-or-similar/src/similar.js"(exports, module2) { | ||
function Similar() { | ||
this.list = []; | ||
this.lastItem = void 0; | ||
this.size = 0; | ||
return this; | ||
} | ||
Similar.prototype.get = function(key2) { | ||
var index; | ||
if (this.lastItem && this.isEqual(this.lastItem.key, key2)) { | ||
return this.lastItem.val; | ||
} | ||
index = this.indexOf(key2); | ||
if (index >= 0) { | ||
this.lastItem = this.list[index]; | ||
return this.list[index].val; | ||
} | ||
return void 0; | ||
}; | ||
Similar.prototype.set = function(key2, val) { | ||
var index; | ||
if (this.lastItem && this.isEqual(this.lastItem.key, key2)) { | ||
this.lastItem.val = val; | ||
return this; | ||
} | ||
index = this.indexOf(key2); | ||
if (index >= 0) { | ||
this.lastItem = this.list[index]; | ||
this.list[index].val = val; | ||
return this; | ||
} | ||
this.lastItem = { key: key2, val }; | ||
this.list.push(this.lastItem); | ||
this.size++; | ||
return this; | ||
}; | ||
Similar.prototype.delete = function(key2) { | ||
var index; | ||
if (this.lastItem && this.isEqual(this.lastItem.key, key2)) { | ||
this.lastItem = void 0; | ||
} | ||
index = this.indexOf(key2); | ||
if (index >= 0) { | ||
this.size--; | ||
return this.list.splice(index, 1)[0]; | ||
} | ||
return void 0; | ||
}; | ||
Similar.prototype.has = function(key2) { | ||
var index; | ||
if (this.lastItem && this.isEqual(this.lastItem.key, key2)) { | ||
return true; | ||
} | ||
index = this.indexOf(key2); | ||
if (index >= 0) { | ||
this.lastItem = this.list[index]; | ||
return true; | ||
} | ||
return false; | ||
}; | ||
Similar.prototype.forEach = function(callback, thisArg) { | ||
var i; | ||
for (i = 0; i < this.size; i++) { | ||
callback.call(thisArg || this, this.list[i].val, this.list[i].key, this); | ||
} | ||
}; | ||
Similar.prototype.indexOf = function(key2) { | ||
var i; | ||
for (i = 0; i < this.size; i++) { | ||
if (this.isEqual(this.list[i].key, key2)) { | ||
return i; | ||
} | ||
} | ||
return -1; | ||
}; | ||
Similar.prototype.isEqual = function(val1, val2) { | ||
return val1 === val2 || val1 !== val1 && val2 !== val2; | ||
}; | ||
module2.exports = Similar; | ||
} | ||
}); | ||
// node_modules/map-or-similar/src/map-or-similar.js | ||
var require_map_or_similar = __commonJS({ | ||
"node_modules/map-or-similar/src/map-or-similar.js"(exports, module2) { | ||
module2.exports = function(forceSimilar) { | ||
if (typeof Map !== "function" || forceSimilar) { | ||
var Similar = require_similar(); | ||
return new Similar(); | ||
} else { | ||
return /* @__PURE__ */ new Map(); | ||
} | ||
}; | ||
} | ||
}); | ||
// node_modules/memoizerific/src/memoizerific.js | ||
var require_memoizerific = __commonJS({ | ||
"node_modules/memoizerific/src/memoizerific.js"(exports, module2) { | ||
var MapOrSimilar = require_map_or_similar(); | ||
module2.exports = function(limit) { | ||
var cache = new MapOrSimilar(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), lru = []; | ||
return function(fn) { | ||
var memoizerific = function() { | ||
var currentCache = cache, newMap, fnResult, argsLengthMinusOne = arguments.length - 1, lruPath = Array(argsLengthMinusOne + 1), isMemoized = true, i; | ||
if ((memoizerific.numArgs || memoizerific.numArgs === 0) && memoizerific.numArgs !== argsLengthMinusOne + 1) { | ||
throw new Error("Memoizerific functions should always be called with the same number of arguments"); | ||
} | ||
for (i = 0; i < argsLengthMinusOne; i++) { | ||
lruPath[i] = { | ||
cacheItem: currentCache, | ||
arg: arguments[i] | ||
}; | ||
if (currentCache.has(arguments[i])) { | ||
currentCache = currentCache.get(arguments[i]); | ||
continue; | ||
} | ||
isMemoized = false; | ||
newMap = new MapOrSimilar(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"); | ||
currentCache.set(arguments[i], newMap); | ||
currentCache = newMap; | ||
} | ||
if (isMemoized) { | ||
if (currentCache.has(arguments[argsLengthMinusOne])) { | ||
fnResult = currentCache.get(arguments[argsLengthMinusOne]); | ||
} else { | ||
isMemoized = false; | ||
} | ||
} | ||
if (!isMemoized) { | ||
fnResult = fn.apply(null, arguments); | ||
currentCache.set(arguments[argsLengthMinusOne], fnResult); | ||
} | ||
if (limit > 0) { | ||
lruPath[argsLengthMinusOne] = { | ||
cacheItem: currentCache, | ||
arg: arguments[argsLengthMinusOne] | ||
}; | ||
if (isMemoized) { | ||
moveToMostRecentLru(lru, lruPath); | ||
} else { | ||
lru.push(lruPath); | ||
} | ||
if (lru.length > limit) { | ||
removeCachedResult(lru.shift()); | ||
} | ||
} | ||
memoizerific.wasMemoized = isMemoized; | ||
memoizerific.numArgs = argsLengthMinusOne + 1; | ||
return fnResult; | ||
}; | ||
memoizerific.limit = limit; | ||
memoizerific.wasMemoized = false; | ||
memoizerific.cache = cache; | ||
memoizerific.lru = lru; | ||
return memoizerific; | ||
}; | ||
}; | ||
function moveToMostRecentLru(lru, lruPath) { | ||
var lruLen = lru.length, lruPathLen = lruPath.length, isMatch, i, ii; | ||
for (i = 0; i < lruLen; i++) { | ||
isMatch = true; | ||
for (ii = 0; ii < lruPathLen; ii++) { | ||
if (!isEqual(lru[i][ii].arg, lruPath[ii].arg)) { | ||
isMatch = false; | ||
break; | ||
} | ||
} | ||
if (isMatch) { | ||
break; | ||
} | ||
} | ||
lru.push(lru.splice(i, 1)[0]); | ||
} | ||
function removeCachedResult(removedLru) { | ||
var removedLruLen = removedLru.length, currentLru = removedLru[removedLruLen - 1], tmp, i; | ||
currentLru.cacheItem.delete(currentLru.arg); | ||
for (i = removedLruLen - 2; i >= 0; i--) { | ||
currentLru = removedLru[i]; | ||
tmp = currentLru.cacheItem.get(currentLru.arg); | ||
if (!tmp || !tmp.size) { | ||
currentLru.cacheItem.delete(currentLru.arg); | ||
} else { | ||
break; | ||
} | ||
} | ||
} | ||
function isEqual(val1, val2) { | ||
return val1 === val2 || val1 !== val1 && val2 !== val2; | ||
} | ||
} | ||
}); | ||
// src/index.ts | ||
@@ -1386,3 +1191,3 @@ var src_exports = {}; | ||
// src/index.ts | ||
var import_memoizerific = __toESM(require_memoizerific()); | ||
var import_memoizerific = __toESM(require("memoizerific")); | ||
@@ -1389,0 +1194,0 @@ // src/dom-event.ts |
{ | ||
"name": "telejson", | ||
"version": "7.0.2", | ||
"version": "7.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
117204
3089
12