@parcel/utils 2.14.4 → 2.15.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.
- package/lib/index.js +149 -65
- package/lib/index.js.map +1 -1
- package/package.json +18 -18
- package/src/index.js +2 -1
- package/src/svgo.js +108 -0
package/lib/index.js
CHANGED
|
@@ -3466,6 +3466,7 @@ $parcel$export(module.exports, "normalizeSeparators", () => $2cfc43e5a1610e21$ex
|
|
|
3466
3466
|
$parcel$export(module.exports, "relativePath", () => $2cfc43e5a1610e21$export$7413eea5ad243d4);
|
|
3467
3467
|
$parcel$export(module.exports, "replaceURLReferences", () => $cbd5168e62104afe$export$d0d0105f44defc19);
|
|
3468
3468
|
$parcel$export(module.exports, "replaceInlineReferences", () => $cbd5168e62104afe$export$f074a8f9bef628fd);
|
|
3469
|
+
$parcel$export(module.exports, "getURLReplacement", () => $cbd5168e62104afe$export$a22ef0cbdf8abc95);
|
|
3469
3470
|
$parcel$export(module.exports, "measureStreamLength", () => $43ad97e2cc03a562$export$457f03b1bf37ec1a);
|
|
3470
3471
|
$parcel$export(module.exports, "readableFromStringOrBuffer", () => $43ad97e2cc03a562$export$dc30d0b81ccad9c7);
|
|
3471
3472
|
$parcel$export(module.exports, "bufferStream", () => $43ad97e2cc03a562$export$f109d1c79a5ae5a1);
|
|
@@ -3483,6 +3484,7 @@ $parcel$export(module.exports, "loadSourceMap", () => $3d4b4a41954c6194$export$c
|
|
|
3483
3484
|
$parcel$export(module.exports, "remapSourceLocation", () => $3d4b4a41954c6194$export$2fed780245c466c1);
|
|
3484
3485
|
$parcel$export(module.exports, "stripAnsi", () => (/*@__PURE__*/$parcel$interopDefault($c6e7686f671d96bd$exports)));
|
|
3485
3486
|
$parcel$export(module.exports, "detectSVGOVersion", () => $898ec9690c913f83$export$d9e46360b4510851);
|
|
3487
|
+
$parcel$export(module.exports, "convertSVGOConfig", () => $898ec9690c913f83$export$cd81e436d777a245);
|
|
3486
3488
|
$parcel$export(module.exports, "getImportMap", () => $26334e67aed21124$export$3e5fb54e0985f82a);
|
|
3487
3489
|
function $2dffa662028edb3d$export$2e2bcd8739ae039(string, startIndex = 0) {
|
|
3488
3490
|
let lines = 1;
|
|
@@ -29906,7 +29908,7 @@ var $a1480222e26dd21e$exports = {};
|
|
|
29906
29908
|
Object.defineProperty($a1480222e26dd21e$exports, "__esModule", {
|
|
29907
29909
|
value: true
|
|
29908
29910
|
});
|
|
29909
|
-
$a1480222e26dd21e$exports.removeDuplicateSlashes = $a1480222e26dd21e$exports.matchAny = $a1480222e26dd21e$exports.convertPatternsToRe = $a1480222e26dd21e$exports.makeRe = $a1480222e26dd21e$exports.getPatternParts = $a1480222e26dd21e$exports.expandBraceExpansion = $a1480222e26dd21e$exports.expandPatternsWithBraceExpansion = $a1480222e26dd21e$exports.isAffectDepthOfReadingPattern = $a1480222e26dd21e$exports.endsWithSlashGlobStar = $a1480222e26dd21e$exports.hasGlobStar = $a1480222e26dd21e$exports.getBaseDirectory = $a1480222e26dd21e$exports.isPatternRelatedToParentDirectory = $a1480222e26dd21e$exports.getPatternsOutsideCurrentDirectory = $a1480222e26dd21e$exports.getPatternsInsideCurrentDirectory = $a1480222e26dd21e$exports.getPositivePatterns = $a1480222e26dd21e$exports.getNegativePatterns = $a1480222e26dd21e$exports.isPositivePattern = $a1480222e26dd21e$exports.isNegativePattern = $a1480222e26dd21e$exports.convertToNegativePattern = $a1480222e26dd21e$exports.convertToPositivePattern = $a1480222e26dd21e$exports.isDynamicPattern = $a1480222e26dd21e$exports.isStaticPattern = void 0;
|
|
29911
|
+
$a1480222e26dd21e$exports.isAbsolute = $a1480222e26dd21e$exports.partitionAbsoluteAndRelative = $a1480222e26dd21e$exports.removeDuplicateSlashes = $a1480222e26dd21e$exports.matchAny = $a1480222e26dd21e$exports.convertPatternsToRe = $a1480222e26dd21e$exports.makeRe = $a1480222e26dd21e$exports.getPatternParts = $a1480222e26dd21e$exports.expandBraceExpansion = $a1480222e26dd21e$exports.expandPatternsWithBraceExpansion = $a1480222e26dd21e$exports.isAffectDepthOfReadingPattern = $a1480222e26dd21e$exports.endsWithSlashGlobStar = $a1480222e26dd21e$exports.hasGlobStar = $a1480222e26dd21e$exports.getBaseDirectory = $a1480222e26dd21e$exports.isPatternRelatedToParentDirectory = $a1480222e26dd21e$exports.getPatternsOutsideCurrentDirectory = $a1480222e26dd21e$exports.getPatternsInsideCurrentDirectory = $a1480222e26dd21e$exports.getPositivePatterns = $a1480222e26dd21e$exports.getNegativePatterns = $a1480222e26dd21e$exports.isPositivePattern = $a1480222e26dd21e$exports.isNegativePattern = $a1480222e26dd21e$exports.convertToNegativePattern = $a1480222e26dd21e$exports.convertToPositivePattern = $a1480222e26dd21e$exports.isDynamicPattern = $a1480222e26dd21e$exports.isStaticPattern = void 0;
|
|
29910
29912
|
|
|
29911
29913
|
var $61d87f3276971c3e$exports = {};
|
|
29912
29914
|
'use strict';
|
|
@@ -31614,6 +31616,21 @@ $a1480222e26dd21e$exports.matchAny = $a1480222e26dd21e$var$matchAny;
|
|
|
31614
31616
|
return pattern.replace($a1480222e26dd21e$var$DOUBLE_SLASH_RE, '/');
|
|
31615
31617
|
}
|
|
31616
31618
|
$a1480222e26dd21e$exports.removeDuplicateSlashes = $a1480222e26dd21e$var$removeDuplicateSlashes;
|
|
31619
|
+
function $a1480222e26dd21e$var$partitionAbsoluteAndRelative(patterns) {
|
|
31620
|
+
const absolute = [];
|
|
31621
|
+
const relative = [];
|
|
31622
|
+
for (const pattern of patterns)if ($a1480222e26dd21e$var$isAbsolute(pattern)) absolute.push(pattern);
|
|
31623
|
+
else relative.push(pattern);
|
|
31624
|
+
return [
|
|
31625
|
+
absolute,
|
|
31626
|
+
relative
|
|
31627
|
+
];
|
|
31628
|
+
}
|
|
31629
|
+
$a1480222e26dd21e$exports.partitionAbsoluteAndRelative = $a1480222e26dd21e$var$partitionAbsoluteAndRelative;
|
|
31630
|
+
function $a1480222e26dd21e$var$isAbsolute(pattern) {
|
|
31631
|
+
return $houHs$path.isAbsolute(pattern);
|
|
31632
|
+
}
|
|
31633
|
+
$a1480222e26dd21e$exports.isAbsolute = $a1480222e26dd21e$var$isAbsolute;
|
|
31617
31634
|
|
|
31618
31635
|
|
|
31619
31636
|
$51df6bfca103aef8$exports.pattern = $a1480222e26dd21e$exports;
|
|
@@ -33188,19 +33205,27 @@ class $b326f718dda03c34$var$EntryFilter {
|
|
|
33188
33205
|
this.index = new Map();
|
|
33189
33206
|
}
|
|
33190
33207
|
getFilter(positive, negative) {
|
|
33191
|
-
const
|
|
33192
|
-
const
|
|
33193
|
-
|
|
33194
|
-
|
|
33195
|
-
|
|
33208
|
+
const [absoluteNegative, relativeNegative] = $51df6bfca103aef8$exports.pattern.partitionAbsoluteAndRelative(negative);
|
|
33209
|
+
const patterns = {
|
|
33210
|
+
positive: {
|
|
33211
|
+
all: $51df6bfca103aef8$exports.pattern.convertPatternsToRe(positive, this._micromatchOptions)
|
|
33212
|
+
},
|
|
33213
|
+
negative: {
|
|
33214
|
+
absolute: $51df6bfca103aef8$exports.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), {
|
|
33215
|
+
dot: true
|
|
33216
|
+
})),
|
|
33217
|
+
relative: $51df6bfca103aef8$exports.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), {
|
|
33218
|
+
dot: true
|
|
33219
|
+
}))
|
|
33220
|
+
}
|
|
33221
|
+
};
|
|
33222
|
+
return (entry)=>this._filter(entry, patterns);
|
|
33196
33223
|
}
|
|
33197
|
-
_filter(entry,
|
|
33224
|
+
_filter(entry, patterns) {
|
|
33198
33225
|
const filepath = $51df6bfca103aef8$exports.path.removeLeadingDotSegment(entry.path);
|
|
33199
33226
|
if (this._settings.unique && this._isDuplicateEntry(filepath)) return false;
|
|
33200
33227
|
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) return false;
|
|
33201
|
-
|
|
33202
|
-
const isDirectory = entry.dirent.isDirectory();
|
|
33203
|
-
const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory);
|
|
33228
|
+
const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());
|
|
33204
33229
|
if (this._settings.unique && isMatched) this._createIndexRecord(filepath);
|
|
33205
33230
|
return isMatched;
|
|
33206
33231
|
}
|
|
@@ -33216,12 +33241,22 @@ class $b326f718dda03c34$var$EntryFilter {
|
|
|
33216
33241
|
_onlyDirectoryFilter(entry) {
|
|
33217
33242
|
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
|
33218
33243
|
}
|
|
33219
|
-
|
|
33220
|
-
|
|
33221
|
-
|
|
33222
|
-
|
|
33244
|
+
_isMatchToPatternsSet(filepath, patterns, isDirectory) {
|
|
33245
|
+
const isMatched = this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory);
|
|
33246
|
+
if (!isMatched) return false;
|
|
33247
|
+
const isMatchedByRelativeNegative = this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory);
|
|
33248
|
+
if (isMatchedByRelativeNegative) return false;
|
|
33249
|
+
const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory);
|
|
33250
|
+
if (isMatchedByAbsoluteNegative) return false;
|
|
33251
|
+
return true;
|
|
33252
|
+
}
|
|
33253
|
+
_isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory) {
|
|
33254
|
+
if (patternsRe.length === 0) return false;
|
|
33255
|
+
const fullpath = $51df6bfca103aef8$exports.path.makeAbsolute(this._settings.cwd, filepath);
|
|
33256
|
+
return this._isMatchToPatterns(fullpath, patternsRe, isDirectory);
|
|
33223
33257
|
}
|
|
33224
33258
|
_isMatchToPatterns(filepath, patternsRe, isDirectory) {
|
|
33259
|
+
if (patternsRe.length === 0) return false;
|
|
33225
33260
|
// Trying to match files and directories by patterns.
|
|
33226
33261
|
const isMatched = $51df6bfca103aef8$exports.pattern.matchAny(filepath, patternsRe);
|
|
33227
33262
|
// A pattern with a trailling slash can be used for directory matching.
|
|
@@ -35123,7 +35158,7 @@ var $83d29ad750833698$var$clone = function() {
|
|
|
35123
35158
|
clone.__getRegExpFlags = __getRegExpFlags;
|
|
35124
35159
|
return clone;
|
|
35125
35160
|
}();
|
|
35126
|
-
if (
|
|
35161
|
+
if ($83d29ad750833698$exports) $83d29ad750833698$exports = $83d29ad750833698$var$clone;
|
|
35127
35162
|
|
|
35128
35163
|
|
|
35129
35164
|
// This is a generated file. Do not edit.
|
|
@@ -36167,17 +36202,17 @@ $9a7a296607515479$export$fac44ee5b035f737 = (parcelRequire("ib1eJ"));
|
|
|
36167
36202
|
|
|
36168
36203
|
/**
|
|
36169
36204
|
* @module LRUCache
|
|
36170
|
-
*/ const $
|
|
36171
|
-
const $
|
|
36172
|
-
/* c8 ignore start */ const $
|
|
36173
|
-
/* c8 ignore start */ const $
|
|
36174
|
-
typeof $
|
|
36175
|
-
};
|
|
36176
|
-
let $
|
|
36177
|
-
let $
|
|
36178
|
-
/* c8 ignore start */ if (typeof $
|
|
36205
|
+
*/ const $eb1586208fd028d6$var$perf = typeof performance === 'object' && performance && typeof performance.now === 'function' ? performance : Date;
|
|
36206
|
+
const $eb1586208fd028d6$var$warned = new Set();
|
|
36207
|
+
/* c8 ignore start */ const $eb1586208fd028d6$var$PROCESS = typeof process === 'object' && !!process ? process : {};
|
|
36208
|
+
/* c8 ignore start */ const $eb1586208fd028d6$var$emitWarning = (msg, type, code, fn)=>{
|
|
36209
|
+
typeof $eb1586208fd028d6$var$PROCESS.emitWarning === 'function' ? $eb1586208fd028d6$var$PROCESS.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`);
|
|
36210
|
+
};
|
|
36211
|
+
let $eb1586208fd028d6$var$AC = globalThis.AbortController;
|
|
36212
|
+
let $eb1586208fd028d6$var$AS = globalThis.AbortSignal;
|
|
36213
|
+
/* c8 ignore start */ if (typeof $eb1586208fd028d6$var$AC === 'undefined') {
|
|
36179
36214
|
//@ts-ignore
|
|
36180
|
-
$
|
|
36215
|
+
$eb1586208fd028d6$var$AS = class AbortSignal {
|
|
36181
36216
|
onabort;
|
|
36182
36217
|
_onabort = [];
|
|
36183
36218
|
reason;
|
|
@@ -36187,11 +36222,11 @@ let $34c2e4b61193a7f9$var$AS = globalThis.AbortSignal;
|
|
|
36187
36222
|
}
|
|
36188
36223
|
};
|
|
36189
36224
|
//@ts-ignore
|
|
36190
|
-
$
|
|
36225
|
+
$eb1586208fd028d6$var$AC = class AbortController {
|
|
36191
36226
|
constructor(){
|
|
36192
36227
|
warnACPolyfill();
|
|
36193
36228
|
}
|
|
36194
|
-
signal = new $
|
|
36229
|
+
signal = new $eb1586208fd028d6$var$AS();
|
|
36195
36230
|
abort(reason) {
|
|
36196
36231
|
if (this.signal.aborted) return;
|
|
36197
36232
|
//@ts-ignore
|
|
@@ -36203,16 +36238,16 @@ let $34c2e4b61193a7f9$var$AS = globalThis.AbortSignal;
|
|
|
36203
36238
|
this.signal.onabort?.(reason);
|
|
36204
36239
|
}
|
|
36205
36240
|
};
|
|
36206
|
-
let printACPolyfillWarning = $
|
|
36241
|
+
let printACPolyfillWarning = $eb1586208fd028d6$var$PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';
|
|
36207
36242
|
const warnACPolyfill = ()=>{
|
|
36208
36243
|
if (!printACPolyfillWarning) return;
|
|
36209
36244
|
printACPolyfillWarning = false;
|
|
36210
|
-
$
|
|
36245
|
+
$eb1586208fd028d6$var$emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);
|
|
36211
36246
|
};
|
|
36212
36247
|
}
|
|
36213
|
-
/* c8 ignore stop */ const $
|
|
36214
|
-
const $
|
|
36215
|
-
const $
|
|
36248
|
+
/* c8 ignore stop */ const $eb1586208fd028d6$var$shouldWarn = (code)=>!$eb1586208fd028d6$var$warned.has(code);
|
|
36249
|
+
const $eb1586208fd028d6$var$TYPE = Symbol('type');
|
|
36250
|
+
const $eb1586208fd028d6$var$isPosInt = (n)=>n && n === Math.floor(n) && n > 0 && isFinite(n);
|
|
36216
36251
|
/* c8 ignore start */ // This is a little bit ridiculous, tbh.
|
|
36217
36252
|
// The maximum array length is 2^32-1 or thereabouts on most JS impls.
|
|
36218
36253
|
// And well before that point, you're caching the entire world, I mean,
|
|
@@ -36221,28 +36256,28 @@ const $34c2e4b61193a7f9$var$isPosInt = (n)=>n && n === Math.floor(n) && n > 0 &&
|
|
|
36221
36256
|
// zeroes at init time is brutal when you get that big.
|
|
36222
36257
|
// But why not be complete?
|
|
36223
36258
|
// Maybe in the future, these limits will have expanded.
|
|
36224
|
-
const $
|
|
36225
|
-
/* c8 ignore stop */ class $
|
|
36259
|
+
const $eb1586208fd028d6$var$getUintArray = (max)=>!$eb1586208fd028d6$var$isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? $eb1586208fd028d6$var$ZeroArray : null;
|
|
36260
|
+
/* c8 ignore stop */ class $eb1586208fd028d6$var$ZeroArray extends Array {
|
|
36226
36261
|
constructor(size){
|
|
36227
36262
|
super(size);
|
|
36228
36263
|
this.fill(0);
|
|
36229
36264
|
}
|
|
36230
36265
|
}
|
|
36231
|
-
class $
|
|
36266
|
+
class $eb1586208fd028d6$var$Stack {
|
|
36232
36267
|
heap;
|
|
36233
36268
|
length;
|
|
36234
36269
|
// private constructor
|
|
36235
36270
|
static #constructing = false;
|
|
36236
36271
|
static create(max) {
|
|
36237
|
-
const HeapCls = $
|
|
36272
|
+
const HeapCls = $eb1586208fd028d6$var$getUintArray(max);
|
|
36238
36273
|
if (!HeapCls) return [];
|
|
36239
|
-
$
|
|
36240
|
-
const s = new $
|
|
36241
|
-
$
|
|
36274
|
+
$eb1586208fd028d6$var$Stack.#constructing = true;
|
|
36275
|
+
const s = new $eb1586208fd028d6$var$Stack(max, HeapCls);
|
|
36276
|
+
$eb1586208fd028d6$var$Stack.#constructing = false;
|
|
36242
36277
|
return s;
|
|
36243
36278
|
}
|
|
36244
36279
|
constructor(max, HeapCls){
|
|
36245
|
-
/* c8 ignore start */ if (!$
|
|
36280
|
+
/* c8 ignore start */ if (!$eb1586208fd028d6$var$Stack.#constructing) throw new TypeError('instantiate Stack using Stack.create(n)');
|
|
36246
36281
|
/* c8 ignore stop */ this.heap = new HeapCls(max);
|
|
36247
36282
|
this.length = 0;
|
|
36248
36283
|
}
|
|
@@ -36253,7 +36288,7 @@ class $34c2e4b61193a7f9$var$Stack {
|
|
|
36253
36288
|
return this.heap[--this.length];
|
|
36254
36289
|
}
|
|
36255
36290
|
}
|
|
36256
|
-
class $
|
|
36291
|
+
class $eb1586208fd028d6$export$182500e6725aad9a {
|
|
36257
36292
|
// options that cannot be changed without disaster
|
|
36258
36293
|
#max;
|
|
36259
36294
|
#maxSize;
|
|
@@ -36400,8 +36435,8 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36400
36435
|
}
|
|
36401
36436
|
constructor(options){
|
|
36402
36437
|
const { max: max = 0, ttl: ttl, ttlResolution: ttlResolution = 1, ttlAutopurge: ttlAutopurge, updateAgeOnGet: updateAgeOnGet, updateAgeOnHas: updateAgeOnHas, allowStale: allowStale, dispose: dispose, disposeAfter: disposeAfter, noDisposeOnSet: noDisposeOnSet, noUpdateTTL: noUpdateTTL, maxSize: maxSize = 0, maxEntrySize: maxEntrySize = 0, sizeCalculation: sizeCalculation, fetchMethod: fetchMethod, memoMethod: memoMethod, noDeleteOnFetchRejection: noDeleteOnFetchRejection, noDeleteOnStaleGet: noDeleteOnStaleGet, allowStaleOnFetchRejection: allowStaleOnFetchRejection, allowStaleOnFetchAbort: allowStaleOnFetchAbort, ignoreFetchAbort: ignoreFetchAbort } = options;
|
|
36403
|
-
if (max !== 0 && !$
|
|
36404
|
-
const UintArray = max ? $
|
|
36438
|
+
if (max !== 0 && !$eb1586208fd028d6$var$isPosInt(max)) throw new TypeError('max option must be a nonnegative integer');
|
|
36439
|
+
const UintArray = max ? $eb1586208fd028d6$var$getUintArray(max) : Array;
|
|
36405
36440
|
if (!UintArray) throw new Error('invalid max value: ' + max);
|
|
36406
36441
|
this.#max = max;
|
|
36407
36442
|
this.#maxSize = maxSize;
|
|
@@ -36423,7 +36458,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36423
36458
|
this.#prev = new UintArray(max);
|
|
36424
36459
|
this.#head = 0;
|
|
36425
36460
|
this.#tail = 0;
|
|
36426
|
-
this.#free = $
|
|
36461
|
+
this.#free = $eb1586208fd028d6$var$Stack.create(max);
|
|
36427
36462
|
this.#size = 0;
|
|
36428
36463
|
this.#calculatedSize = 0;
|
|
36429
36464
|
if (typeof dispose === 'function') this.#dispose = dispose;
|
|
@@ -36445,30 +36480,30 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36445
36480
|
// NB: maxEntrySize is set to maxSize if it's set
|
|
36446
36481
|
if (this.maxEntrySize !== 0) {
|
|
36447
36482
|
if (this.#maxSize !== 0) {
|
|
36448
|
-
if (!$
|
|
36483
|
+
if (!$eb1586208fd028d6$var$isPosInt(this.#maxSize)) throw new TypeError('maxSize must be a positive integer if specified');
|
|
36449
36484
|
}
|
|
36450
|
-
if (!$
|
|
36485
|
+
if (!$eb1586208fd028d6$var$isPosInt(this.maxEntrySize)) throw new TypeError('maxEntrySize must be a positive integer if specified');
|
|
36451
36486
|
this.#initializeSizeTracking();
|
|
36452
36487
|
}
|
|
36453
36488
|
this.allowStale = !!allowStale;
|
|
36454
36489
|
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
|
36455
36490
|
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
36456
36491
|
this.updateAgeOnHas = !!updateAgeOnHas;
|
|
36457
|
-
this.ttlResolution = $
|
|
36492
|
+
this.ttlResolution = $eb1586208fd028d6$var$isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
|
|
36458
36493
|
this.ttlAutopurge = !!ttlAutopurge;
|
|
36459
36494
|
this.ttl = ttl || 0;
|
|
36460
36495
|
if (this.ttl) {
|
|
36461
|
-
if (!$
|
|
36496
|
+
if (!$eb1586208fd028d6$var$isPosInt(this.ttl)) throw new TypeError('ttl must be a positive integer if specified');
|
|
36462
36497
|
this.#initializeTTLTracking();
|
|
36463
36498
|
}
|
|
36464
36499
|
// do not allow completely unbounded caches
|
|
36465
36500
|
if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) throw new TypeError('At least one of max, maxSize, or ttl is required');
|
|
36466
36501
|
if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
|
|
36467
36502
|
const code = 'LRU_CACHE_UNBOUNDED';
|
|
36468
|
-
if ($
|
|
36469
|
-
$
|
|
36503
|
+
if ($eb1586208fd028d6$var$shouldWarn(code)) {
|
|
36504
|
+
$eb1586208fd028d6$var$warned.add(code);
|
|
36470
36505
|
const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";
|
|
36471
|
-
$
|
|
36506
|
+
$eb1586208fd028d6$var$emitWarning(msg, 'UnboundedCacheWarning', code, $eb1586208fd028d6$export$182500e6725aad9a);
|
|
36472
36507
|
}
|
|
36473
36508
|
}
|
|
36474
36509
|
}
|
|
@@ -36479,11 +36514,11 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36479
36514
|
return this.#keyMap.has(key) ? Infinity : 0;
|
|
36480
36515
|
}
|
|
36481
36516
|
#initializeTTLTracking() {
|
|
36482
|
-
const ttls = new $
|
|
36483
|
-
const starts = new $
|
|
36517
|
+
const ttls = new $eb1586208fd028d6$var$ZeroArray(this.#max);
|
|
36518
|
+
const starts = new $eb1586208fd028d6$var$ZeroArray(this.#max);
|
|
36484
36519
|
this.#ttls = ttls;
|
|
36485
36520
|
this.#starts = starts;
|
|
36486
|
-
this.#setItemTTL = (index, ttl, start = $
|
|
36521
|
+
this.#setItemTTL = (index, ttl, start = $eb1586208fd028d6$var$perf.now())=>{
|
|
36487
36522
|
starts[index] = ttl !== 0 ? start : 0;
|
|
36488
36523
|
ttls[index] = ttl;
|
|
36489
36524
|
if (ttl !== 0 && this.ttlAutopurge) {
|
|
@@ -36495,7 +36530,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36495
36530
|
/* c8 ignore stop */ }
|
|
36496
36531
|
};
|
|
36497
36532
|
this.#updateItemAge = (index)=>{
|
|
36498
|
-
starts[index] = ttls[index] !== 0 ? $
|
|
36533
|
+
starts[index] = ttls[index] !== 0 ? $eb1586208fd028d6$var$perf.now() : 0;
|
|
36499
36534
|
};
|
|
36500
36535
|
this.#statusTTL = (status, index)=>{
|
|
36501
36536
|
if (ttls[index]) {
|
|
@@ -36513,7 +36548,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36513
36548
|
// that costly call repeatedly.
|
|
36514
36549
|
let cachedNow = 0;
|
|
36515
36550
|
const getNow = ()=>{
|
|
36516
|
-
const n = $
|
|
36551
|
+
const n = $eb1586208fd028d6$var$perf.now();
|
|
36517
36552
|
if (this.ttlResolution > 0) {
|
|
36518
36553
|
cachedNow = n;
|
|
36519
36554
|
const t = setTimeout(()=>cachedNow = 0, this.ttlResolution);
|
|
@@ -36543,7 +36578,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36543
36578
|
#setItemTTL = ()=>{};
|
|
36544
36579
|
/* c8 ignore stop */ #isStale = ()=>false;
|
|
36545
36580
|
#initializeSizeTracking() {
|
|
36546
|
-
const sizes = new $
|
|
36581
|
+
const sizes = new $eb1586208fd028d6$var$ZeroArray(this.#max);
|
|
36547
36582
|
this.#calculatedSize = 0;
|
|
36548
36583
|
this.#sizes = sizes;
|
|
36549
36584
|
this.#removeItemSize = (index)=>{
|
|
@@ -36554,11 +36589,11 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36554
36589
|
// provisionally accept background fetches.
|
|
36555
36590
|
// actual value size will be checked when they return.
|
|
36556
36591
|
if (this.#isBackgroundFetch(v)) return 0;
|
|
36557
|
-
if (!$
|
|
36592
|
+
if (!$eb1586208fd028d6$var$isPosInt(size)) {
|
|
36558
36593
|
if (sizeCalculation) {
|
|
36559
36594
|
if (typeof sizeCalculation !== 'function') throw new TypeError('sizeCalculation must be a function');
|
|
36560
36595
|
size = sizeCalculation(v, k);
|
|
36561
|
-
if (!$
|
|
36596
|
+
if (!$eb1586208fd028d6$var$isPosInt(size)) throw new TypeError('sizeCalculation return invalid (expect positive integer)');
|
|
36562
36597
|
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
36563
36598
|
}
|
|
36564
36599
|
return size;
|
|
@@ -36749,7 +36784,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36749
36784
|
const ttl = this.#ttls[i];
|
|
36750
36785
|
const start = this.#starts[i];
|
|
36751
36786
|
if (ttl && start) {
|
|
36752
|
-
const remain = ttl - ($
|
|
36787
|
+
const remain = ttl - ($eb1586208fd028d6$var$perf.now() - start);
|
|
36753
36788
|
entry.ttl = remain;
|
|
36754
36789
|
entry.start = Date.now();
|
|
36755
36790
|
}
|
|
@@ -36785,7 +36820,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36785
36820
|
entry.ttl = this.#ttls[i];
|
|
36786
36821
|
// always dump the start relative to a portable timestamp
|
|
36787
36822
|
// it's ok for this to be a bit slow, it's a rare operation.
|
|
36788
|
-
const age = $
|
|
36823
|
+
const age = $eb1586208fd028d6$var$perf.now() - this.#starts[i];
|
|
36789
36824
|
entry.start = Math.floor(Date.now() - age);
|
|
36790
36825
|
}
|
|
36791
36826
|
if (this.#sizes) entry.size = this.#sizes[i];
|
|
@@ -36815,7 +36850,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
36815
36850
|
//
|
|
36816
36851
|
// it's ok for this to be a bit slow, it's a rare operation.
|
|
36817
36852
|
const age = Date.now() - entry.start;
|
|
36818
|
-
entry.start = $
|
|
36853
|
+
entry.start = $eb1586208fd028d6$var$perf.now() - age;
|
|
36819
36854
|
}
|
|
36820
36855
|
this.set(key, entry.value, entry);
|
|
36821
36856
|
}
|
|
@@ -37028,7 +37063,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
37028
37063
|
#backgroundFetch(k, index, options, context) {
|
|
37029
37064
|
const v = index === undefined ? undefined : this.#valList[index];
|
|
37030
37065
|
if (this.#isBackgroundFetch(v)) return v;
|
|
37031
|
-
const ac = new $
|
|
37066
|
+
const ac = new $eb1586208fd028d6$var$AC();
|
|
37032
37067
|
const { signal: signal } = options;
|
|
37033
37068
|
// when/if our AC signals, then stop listening to theirs.
|
|
37034
37069
|
signal?.addEventListener('abort', ()=>ac.abort(signal.reason), {
|
|
@@ -37126,7 +37161,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
37126
37161
|
#isBackgroundFetch(p) {
|
|
37127
37162
|
if (!this.#hasFetchMethod) return false;
|
|
37128
37163
|
const b = p;
|
|
37129
|
-
return !!b && b instanceof Promise && b.hasOwnProperty('__staleWhileFetching') && b.__abortController instanceof $
|
|
37164
|
+
return !!b && b instanceof Promise && b.hasOwnProperty('__staleWhileFetching') && b.__abortController instanceof $eb1586208fd028d6$var$AC;
|
|
37130
37165
|
}
|
|
37131
37166
|
async fetch(k, fetchOptions = {}) {
|
|
37132
37167
|
const { allowStale: // get options
|
|
@@ -37363,7 +37398,7 @@ class $34c2e4b61193a7f9$export$182500e6725aad9a {
|
|
|
37363
37398
|
}
|
|
37364
37399
|
|
|
37365
37400
|
|
|
37366
|
-
const $37dda638e06feff5$var$configCache = new (0, $
|
|
37401
|
+
const $37dda638e06feff5$var$configCache = new (0, $eb1586208fd028d6$export$182500e6725aad9a)({
|
|
37367
37402
|
max: 500
|
|
37368
37403
|
});
|
|
37369
37404
|
const $37dda638e06feff5$var$resolveCache = new Map();
|
|
@@ -38213,6 +38248,8 @@ $7865b56d1a966ce7$exports = ({ onlyFirst: onlyFirst = false } = {})=>{
|
|
|
38213
38248
|
$c6e7686f671d96bd$exports = (string)=>typeof string === 'string' ? string.replace($7865b56d1a966ce7$exports(), '') : string;
|
|
38214
38249
|
|
|
38215
38250
|
|
|
38251
|
+
|
|
38252
|
+
|
|
38216
38253
|
function $898ec9690c913f83$export$d9e46360b4510851(config) {
|
|
38217
38254
|
if (!config) return {
|
|
38218
38255
|
version: 3
|
|
@@ -38251,6 +38288,53 @@ function $898ec9690c913f83$export$d9e46360b4510851(config) {
|
|
|
38251
38288
|
version: 3
|
|
38252
38289
|
};
|
|
38253
38290
|
}
|
|
38291
|
+
async function $898ec9690c913f83$export$cd81e436d777a245(config, filePath, jsonPath, fs, hint) {
|
|
38292
|
+
if (typeof config === 'boolean') return {
|
|
38293
|
+
default: config
|
|
38294
|
+
};
|
|
38295
|
+
if (!config || typeof config !== 'object') return {
|
|
38296
|
+
default: true
|
|
38297
|
+
};
|
|
38298
|
+
let result = {
|
|
38299
|
+
default: false
|
|
38300
|
+
};
|
|
38301
|
+
if (Array.isArray(config.plugins)) for (let [i, plugin] of config.plugins.entries()){
|
|
38302
|
+
let name, params = true;
|
|
38303
|
+
if (typeof plugin === 'string') name = plugin;
|
|
38304
|
+
else if (typeof plugin === 'object' && typeof plugin?.name === 'string') {
|
|
38305
|
+
name = plugin.name;
|
|
38306
|
+
params = plugin.params ?? true;
|
|
38307
|
+
if (typeof plugin.fn === 'function') await $898ec9690c913f83$var$throwDiagnostic('Unsupported custom SVGO plugin.', filePath, `${jsonPath}/plugins/${i}/fn`, fs, hint);
|
|
38308
|
+
} else if (typeof plugin === 'function') await $898ec9690c913f83$var$throwDiagnostic('Unsupported custom SVGO plugin.', filePath, `${jsonPath}/plugins/${i}`, fs, hint);
|
|
38309
|
+
else continue;
|
|
38310
|
+
if (name === 'cleanupIDs') name = 'cleanupIds';
|
|
38311
|
+
if (name === 'preset-default') {
|
|
38312
|
+
result.default = true;
|
|
38313
|
+
if (typeof params === 'object' && typeof params?.overrides === 'object' && params.overrides) for(let key in params.overrides)result[key] = params.overrides[key];
|
|
38314
|
+
} else if (typeof name === 'string') result[name] = params || false;
|
|
38315
|
+
}
|
|
38316
|
+
return result;
|
|
38317
|
+
}
|
|
38318
|
+
async function $898ec9690c913f83$var$throwDiagnostic(message, filePath, jsonPath, fs, hint) {
|
|
38319
|
+
throw new (0, ($parcel$interopDefault($houHs$parceldiagnostic)))({
|
|
38320
|
+
diagnostic: {
|
|
38321
|
+
message: message,
|
|
38322
|
+
codeFrames: [
|
|
38323
|
+
{
|
|
38324
|
+
filePath: filePath,
|
|
38325
|
+
codeHighlights: (0, ($parcel$interopDefault($houHs$path))).extname(filePath) === '' || (0, ($parcel$interopDefault($houHs$path))).extname(filePath) === '.json' ? (0, $houHs$parceldiagnostic.generateJSONCodeHighlights)(await fs.readFile(filePath, 'utf8'), [
|
|
38326
|
+
{
|
|
38327
|
+
key: jsonPath
|
|
38328
|
+
}
|
|
38329
|
+
]) : []
|
|
38330
|
+
}
|
|
38331
|
+
],
|
|
38332
|
+
hints: hint ? [
|
|
38333
|
+
hint
|
|
38334
|
+
] : []
|
|
38335
|
+
}
|
|
38336
|
+
});
|
|
38337
|
+
}
|
|
38254
38338
|
|
|
38255
38339
|
|
|
38256
38340
|
|