From ffa98fbd34ba5f1a421a33f5de1fef0e66a25eeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Apr 2022 00:23:41 +0000 Subject: [PATCH 1/2] Bump semver from 7.3.6 to 7.3.7 Bumps [semver](https://github.com/npm/node-semver) from 7.3.6 to 7.3.7. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.3.6...v7.3.7) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 0838e8206..1c99245f6 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "lodash": "4.17.21", "probot": "12.2.2", "regex-parser": "2.2.11", - "semver": "7.3.6" + "semver": "7.3.7" }, "devDependencies": { "@koa-lite/joi-schema": "0.0.1", diff --git a/yarn.lock b/yarn.lock index b74b4bd7d..bd259b1cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3583,11 +3583,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lru-cache@^7.4.0: - version "7.7.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.7.3.tgz#98cd19eef89ce6a4a3c4502c17c833888677c252" - integrity sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw== - lru_map@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" @@ -4436,12 +4431,12 @@ semver-diff@^3.1.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@7.3.6, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: - version "7.3.6" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.6.tgz#5d73886fb9c0c6602e79440b97165c29581cbb2b" - integrity sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w== +semver@7.3.7, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== dependencies: - lru-cache "^7.4.0" + lru-cache "^6.0.0" semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: version "6.3.0" From 942c19aacafbc05371eb60293427ee2e02b2a76d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 13 Apr 2022 00:24:27 +0000 Subject: [PATCH 2/2] Apply dist/index.js changes --- dist/index.js | 814 +------------------------------------------------- 1 file changed, 6 insertions(+), 808 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7e2f93f63..98d8baea9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -129171,7 +129171,7 @@ class Range { } module.exports = Range -const LRU = __nccwpck_require__(81196) +const LRU = __nccwpck_require__(7129) const cache = new LRU({ max: 1000 }) const parseOptions = __nccwpck_require__(40785) @@ -129770,7 +129770,7 @@ class SemVer { if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } @@ -130033,7 +130033,10 @@ const inc = (version, release, options, identifier) => { } try { - return new SemVer(version, options).inc(release, identifier).version + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier).version } catch (er) { return null } @@ -130546,811 +130549,6 @@ createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') -/***/ }), - -/***/ 81196: -/***/ ((module) => { - -const perf = typeof performance === 'object' && performance && - typeof performance.now === 'function' ? performance : Date - -const hasAbortController = typeof AbortController !== 'undefined' - -/* istanbul ignore next - minimal backwards compatibility polyfill */ -const AC = hasAbortController ? AbortController : Object.assign( - class AbortController { - constructor () { this.signal = new AC.AbortSignal } - abort () { this.signal.aborted = true } - }, - { AbortSignal: class AbortSignal { constructor () { this.aborted = false }}} -) - -const warned = new Set() -const deprecatedOption = (opt, instead) => { - const code = `LRU_CACHE_OPTION_${opt}` - if (shouldWarn(code)) { - warn(code, `${opt} option`, `options.${instead}`, LRUCache) - } -} -const deprecatedMethod = (method, instead) => { - const code = `LRU_CACHE_METHOD_${method}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, method) - warn(code, `${method} method`, `cache.${instead}()`, get) - } -} -const deprecatedProperty = (field, instead) => { - const code = `LRU_CACHE_PROPERTY_${field}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, field) - warn(code, `${field} property`, `cache.${instead}`, get) - } -} - -const shouldWarn = code => typeof process === 'object' && - process && - !warned.has(code) - -const warn = (code, what, instead, fn) => { - warned.add(code) - const msg = `The ${what} is deprecated. Please use ${instead} instead.` - process.emitWarning(msg, 'DeprecationWarning', code, fn) -} - -const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) - -/* istanbul ignore next - This is a little bit ridiculous, tbh. - * The maximum array length is 2^32-1 or thereabouts on most JS impls. - * And well before that point, you're caching the entire world, I mean, - * that's ~32GB of just integers for the next/prev links, plus whatever - * else to hold that many keys and values. Just filling the memory with - * zeroes at init time is brutal when you get that big. - * But why not be complete? - * Maybe in the future, these limits will have expanded. */ -const getUintArray = max => !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 ? ZeroArray -: null - -class ZeroArray extends Array { - constructor (size) { - super(size) - this.fill(0) - } -} - -class Stack { - constructor (max) { - const UintArray = max ? getUintArray(max) : Array - this.heap = new UintArray(max) - this.length = 0 - } - push (n) { - this.heap[this.length++] = n - } - pop () { - return this.heap[--this.length] - } -} - -class LRUCache { - constructor (options = {}) { - const { - max = 0, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize = 0, - sizeCalculation, - fetchMethod, - } = options - - // deprecated options, don't trigger a warning for getting them if - // the thing being passed in is another LRUCache we're copying. - const { - length, - maxAge, - stale, - } = options instanceof LRUCache ? {} : options - - if (max !== 0 && !isPosInt(max)) { - throw new TypeError('max option must be a nonnegative integer') - } - - const UintArray = max ? getUintArray(max) : Array - if (!UintArray) { - throw new Error('invalid max value: ' + max) - } - - this.max = max - this.maxSize = maxSize - this.sizeCalculation = sizeCalculation || length - if (this.sizeCalculation) { - if (!this.maxSize) { - throw new TypeError('cannot set sizeCalculation without setting maxSize') - } - if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation set to non-function') - } - } - - this.fetchMethod = fetchMethod || null - if (this.fetchMethod && typeof this.fetchMethod !== 'function') { - throw new TypeError('fetchMethod must be a function if specified') - } - - - this.keyMap = new Map() - this.keyList = new Array(max).fill(null) - this.valList = new Array(max).fill(null) - this.next = new UintArray(max) - this.prev = new UintArray(max) - this.head = 0 - this.tail = 0 - this.free = new Stack(max) - this.initialFill = 1 - this.size = 0 - - if (typeof dispose === 'function') { - this.dispose = dispose - } - if (typeof disposeAfter === 'function') { - this.disposeAfter = disposeAfter - this.disposed = [] - } else { - this.disposeAfter = null - this.disposed = null - } - this.noDisposeOnSet = !!noDisposeOnSet - this.noUpdateTTL = !!noUpdateTTL - - if (this.maxSize !== 0) { - if (!isPosInt(this.maxSize)) { - throw new TypeError('maxSize must be a positive integer if specified') - } - this.initializeSizeTracking() - } - - this.allowStale = !!allowStale || !!stale - this.updateAgeOnGet = !!updateAgeOnGet - this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 - ? ttlResolution : 1 - this.ttlAutopurge = !!ttlAutopurge - this.ttl = ttl || maxAge || 0 - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError('ttl must be a positive integer if specified') - } - this.initializeTTLTracking() - } - - // do not allow completely unbounded caches - if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { - throw new TypeError('At least one of max, maxSize, or ttl is required') - } - if (!this.ttlAutopurge && !this.max && !this.maxSize) { - const code = 'LRU_CACHE_UNBOUNDED' - if (shouldWarn(code)) { - warned.add(code) - const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + - 'result in unbounded memory consumption.' - process.emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) - } - } - - if (stale) { - deprecatedOption('stale', 'allowStale') - } - if (maxAge) { - deprecatedOption('maxAge', 'ttl') - } - if (length) { - deprecatedOption('length', 'sizeCalculation') - } - } - - getRemainingTTL (key) { - return this.has(key) ? Infinity : 0 - } - - initializeTTLTracking () { - this.ttls = new ZeroArray(this.max) - this.starts = new ZeroArray(this.max) - - this.setItemTTL = (index, ttl) => { - this.starts[index] = ttl !== 0 ? perf.now() : 0 - this.ttls[index] = ttl - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.isStale(index)) { - this.delete(this.keyList[index]) - } - }, ttl + 1) - /* istanbul ignore else - unref() not supported on all platforms */ - if (t.unref) { - t.unref() - } - } - } - - this.updateItemAge = (index) => { - this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 - } - - // debounce calls to perf.now() to 1s so we're not hitting - // that costly call repeatedly. - let cachedNow = 0 - const getNow = () => { - const n = perf.now() - if (this.ttlResolution > 0) { - cachedNow = n - const t = setTimeout(() => cachedNow = 0, this.ttlResolution) - /* istanbul ignore else - not available on all platforms */ - if (t.unref) { - t.unref() - } - } - return n - } - - this.getRemainingTTL = (key) => { - const index = this.keyMap.get(key) - if (index === undefined) { - return 0 - } - return this.ttls[index] === 0 || this.starts[index] === 0 ? Infinity - : ((this.starts[index] + this.ttls[index]) - (cachedNow || getNow())) - } - - this.isStale = (index) => { - return this.ttls[index] !== 0 && this.starts[index] !== 0 && - ((cachedNow || getNow()) - this.starts[index] > this.ttls[index]) - } - } - updateItemAge (index) {} - setItemTTL (index, ttl) {} - isStale (index) { return false } - - initializeSizeTracking () { - this.calculatedSize = 0 - this.sizes = new ZeroArray(this.max) - this.removeItemSize = index => this.calculatedSize -= this.sizes[index] - this.requireSize = (k, v, size, sizeCalculation) => { - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation must be a function') - } - size = sizeCalculation(v, k) - if (!isPosInt(size)) { - throw new TypeError('sizeCalculation return invalid (expect positive integer)') - } - } else { - throw new TypeError('invalid size value (must be positive integer)') - } - } - return size - } - this.addItemSize = (index, v, k, size) => { - this.sizes[index] = size - const maxSize = this.maxSize - this.sizes[index] - while (this.calculatedSize > maxSize) { - this.evict() - } - this.calculatedSize += this.sizes[index] - } - this.delete = k => { - if (this.size !== 0) { - const index = this.keyMap.get(k) - if (index !== undefined) { - this.calculatedSize -= this.sizes[index] - } - } - return LRUCache.prototype.delete.call(this, k) - } - } - removeItemSize (index) {} - addItemSize (index, v, k, size) {} - requireSize (k, v, size, sizeCalculation) { - if (size || sizeCalculation) { - throw new TypeError('cannot set size without setting maxSize on cache') - } - } - - *indexes ({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.tail; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.head) { - break - } else { - i = this.prev[i] - } - } - } - } - - *rindexes ({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.head; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.tail) { - break - } else { - i = this.next[i] - } - } - } - } - - isValidIndex (index) { - return this.keyMap.get(this.keyList[index]) === index - } - - *entries () { - for (const i of this.indexes()) { - yield [this.keyList[i], this.valList[i]] - } - } - *rentries () { - for (const i of this.rindexes()) { - yield [this.keyList[i], this.valList[i]] - } - } - - *keys () { - for (const i of this.indexes()) { - yield this.keyList[i] - } - } - *rkeys () { - for (const i of this.rindexes()) { - yield this.keyList[i] - } - } - - *values () { - for (const i of this.indexes()) { - yield this.valList[i] - } - } - *rvalues () { - for (const i of this.rindexes()) { - yield this.valList[i] - } - } - - [Symbol.iterator] () { - return this.entries() - } - - find (fn, getOptions = {}) { - for (const i of this.indexes()) { - if (fn(this.valList[i], this.keyList[i], this)) { - return this.get(this.keyList[i], getOptions) - } - } - } - - forEach (fn, thisp = this) { - for (const i of this.indexes()) { - fn.call(thisp, this.valList[i], this.keyList[i], this) - } - } - - rforEach (fn, thisp = this) { - for (const i of this.rindexes()) { - fn.call(thisp, this.valList[i], this.keyList[i], this) - } - } - - get prune () { - deprecatedMethod('prune', 'purgeStale') - return this.purgeStale - } - - purgeStale () { - let deleted = false - for (const i of this.rindexes({ allowStale: true })) { - if (this.isStale(i)) { - this.delete(this.keyList[i]) - deleted = true - } - } - return deleted - } - - dump () { - const arr = [] - for (const i of this.indexes()) { - const key = this.keyList[i] - const value = this.valList[i] - const entry = { value } - if (this.ttls) { - entry.ttl = this.ttls[i] - } - if (this.sizes) { - entry.size = this.sizes[i] - } - arr.unshift([key, entry]) - } - return arr - } - - load (arr) { - this.clear() - for (const [key, entry] of arr) { - this.set(key, entry.value, entry) - } - } - - dispose (v, k, reason) {} - - set (k, v, { - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - } = {}) { - size = this.requireSize(k, v, size, sizeCalculation) - let index = this.size === 0 ? undefined : this.keyMap.get(k) - if (index === undefined) { - // addition - index = this.newIndex() - this.keyList[index] = k - this.valList[index] = v - this.keyMap.set(k, index) - this.next[this.tail] = index - this.prev[index] = this.tail - this.tail = index - this.size ++ - this.addItemSize(index, v, k, size) - noUpdateTTL = false - } else { - // update - const oldVal = this.valList[index] - if (v !== oldVal) { - if (this.isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort() - } else { - if (!noDisposeOnSet) { - this.dispose(oldVal, k, 'set') - if (this.disposeAfter) { - this.disposed.push([oldVal, k, 'set']) - } - } - } - this.removeItemSize(index) - this.valList[index] = v - this.addItemSize(index, v, k, size) - } - this.moveToTail(index) - } - if (ttl !== 0 && this.ttl === 0 && !this.ttls) { - this.initializeTTLTracking() - } - if (!noUpdateTTL) { - this.setItemTTL(index, ttl) - } - if (this.disposeAfter) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return this - } - - newIndex () { - if (this.size === 0) { - return this.tail - } - if (this.size === this.max) { - return this.evict() - } - if (this.free.length !== 0) { - return this.free.pop() - } - // initial fill, just keep writing down the list - return this.initialFill++ - } - - pop () { - if (this.size) { - const val = this.valList[this.head] - this.evict() - return val - } - } - - evict () { - const head = this.head - const k = this.keyList[head] - const v = this.valList[head] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort() - } else { - this.dispose(v, k, 'evict') - if (this.disposeAfter) { - this.disposed.push([v, k, 'evict']) - } - } - this.removeItemSize(head) - this.head = this.next[head] - this.keyMap.delete(k) - this.size -- - return head - } - - has (k) { - return this.keyMap.has(k) && !this.isStale(this.keyMap.get(k)) - } - - // like get(), but without any LRU updating or TTL expiration - peek (k, { allowStale = this.allowStale } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined && (allowStale || !this.isStale(index))) { - return this.valList[index] - } - } - - backgroundFetch (k, index, options) { - const v = index === undefined ? undefined : this.valList[index] - if (this.isBackgroundFetch(v)) { - return v - } - const ac = new AC() - const fetchOpts = { - signal: ac.signal, - options, - } - const p = Promise.resolve(this.fetchMethod(k, v, fetchOpts)).then(v => { - if (!ac.signal.aborted) { - this.set(k, v, fetchOpts.options) - } - return v - }) - p.__abortController = ac - p.__staleWhileFetching = v - if (index === undefined) { - this.set(k, p, fetchOpts.options) - index = this.keyMap.get(k) - } else { - this.valList[index] = p - } - return p - } - - isBackgroundFetch (p) { - return p && typeof p === 'object' && typeof p.then === 'function' && - Object.prototype.hasOwnProperty.call(p, '__staleWhileFetching') - } - - // this takes the union of get() and set() opts, because it does both - async fetch (k, { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - } = {}) { - if (!this.fetchMethod) { - return this.get(k, {allowStale, updateAgeOnGet}) - } - - const options = { - allowStale, - updateAgeOnGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - } - - let index = this.keyMap.get(k) - if (index === undefined) { - return this.backgroundFetch(k, index, options) - } else { - // in cache, maybe already fetching - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - return allowStale && v.__staleWhileFetching !== undefined - ? v.__staleWhileFetching : v - } - - if (!this.isStale(index)) { - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return v - } - - // ok, it is stale, and not already fetching - // refresh the cache. - const p = this.backgroundFetch(k, index, options) - return allowStale && p.__staleWhileFetching !== undefined - ? p.__staleWhileFetching : p - } - } - - get (k, { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined) { - const value = this.valList[index] - const fetching = this.isBackgroundFetch(value) - if (this.isStale(index)) { - // delete only if not an in-flight background fetch - if (!fetching) { - this.delete(k) - return allowStale ? value : undefined - } else { - return allowStale ? value.__staleWhileFetching : undefined - } - } else { - // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching, - // so we just return undefined - if (fetching) { - return undefined - } - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return value - } - } - } - - connect (p, n) { - this.prev[n] = p - this.next[p] = n - } - - moveToTail (index) { - // if tail already, nothing to do - // if head, move head to next[index] - // else - // move next[prev[index]] to next[index] (head has no prev) - // move prev[next[index]] to prev[index] - // prev[index] = tail - // next[tail] = index - // tail = index - if (index !== this.tail) { - if (index === this.head) { - this.head = this.next[index] - } else { - this.connect(this.prev[index], this.next[index]) - } - this.connect(this.tail, index) - this.tail = index - } - } - - get del () { - deprecatedMethod('del', 'delete') - return this.delete - } - delete (k) { - let deleted = false - if (this.size !== 0) { - const index = this.keyMap.get(k) - if (index !== undefined) { - deleted = true - if (this.size === 1) { - this.clear() - } else { - this.removeItemSize(index) - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort() - } else { - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - this.keyMap.delete(k) - this.keyList[index] = null - this.valList[index] = null - if (index === this.tail) { - this.tail = this.prev[index] - } else if (index === this.head) { - this.head = this.next[index] - } else { - this.next[this.prev[index]] = this.next[index] - this.prev[this.next[index]] = this.prev[index] - } - this.size -- - this.free.push(index) - } - } - } - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return deleted - } - - clear () { - for (const index of this.rindexes({ allowStale: true })) { - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort() - } else { - const k = this.keyList[index] - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - } - - this.keyMap.clear() - this.valList.fill(null) - this.keyList.fill(null) - if (this.ttls) { - this.ttls.fill(0) - this.starts.fill(0) - } - if (this.sizes) { - this.sizes.fill(0) - } - this.head = 0 - this.tail = 0 - this.initialFill = 1 - this.free.length = 0 - this.calculatedSize = 0 - this.size = 0 - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - } - get reset () { - deprecatedMethod('reset', 'clear') - return this.clear - } - - get length () { - deprecatedProperty('length', 'size') - return this.size - } -} - -module.exports = LRUCache - - /***/ }), /***/ 9380: