diff --git a/node_modules/@npmcli/git/node_modules/lru-cache/bundle/main.js b/node_modules/@npmcli/git/node_modules/lru-cache/bundle/main.js deleted file mode 100644 index 7eef327e92527..0000000000000 --- a/node_modules/@npmcli/git/node_modules/lru-cache/bundle/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var t={10:t=>{const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=new Set,e=(t,i)=>{const s=`LRU_CACHE_OPTION_${t}`;l(s)&&o(s,`${t} option`,`options.${i}`,d)},h=(t,i)=>{const s=`LRU_CACHE_METHOD_${t}`;if(l(s)){const{prototype:e}=d,{get:h}=Object.getOwnPropertyDescriptor(e,t);o(s,`${t} method`,`cache.${i}()`,h)}},l=t=>!(process.noDeprecation||s.has(t)),o=(t,i,e,h)=>{s.add(t),process.emitWarning(`The ${i} is deprecated. Please use ${e} instead.`,"DeprecationWarning",t,h)},n=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),a=t=>n(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?r:null:null;class r extends Array{constructor(t){super(t),this.fill(0)}}class p{constructor(t){const i=a(t);this.heap=new i(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class d{constructor(t={}){const{max:i,ttl:s,ttlResolution:h=1,ttlAutopurge:l,updateAgeOnGet:o,allowStale:r,dispose:c,disposeAfter:f,noDisposeOnSet:u,noUpdateTTL:z,maxSize:v,sizeCalculation:y}=t,{length:g,maxAge:m,stale:S}=t instanceof d?{}:t;if(!n(i))throw new TypeError("max option must be an integer");const x=a(i);if(!x)throw new Error("invalid max value: "+i);if(this.max=i,this.maxSize=v||0,this.sizeCalculation=y||g,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculating set to non-function")}if(this.keyMap=new Map,this.keyList=new Array(i).fill(null),this.valList=new Array(i).fill(null),this.next=new x(i),this.prev=new x(i),this.head=0,this.tail=0,this.free=new p(i),this.initialFill=1,this.size=0,"function"==typeof c&&(this.dispose=c),"function"==typeof f?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!z,this.maxSize){if(!n(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!r||!!S,this.updateAgeOnGet=!!o,this.ttlResolution=n(h)||0===h?h:1,this.ttlAutopurge=!!l,this.ttl=s||m||0,this.ttl){if(!n(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}S&&e("stale","allowStale"),m&&e("maxAge","ttl"),g&&e("length","sizeCalculation")}initializeTTLTracking(){this.ttls=new r(this.max),this.starts=new r(this.max),this.setItemTTL=(t,s)=>{if(this.starts[t]=0!==s?i.now():0,this.ttls[t]=s,0!==s&&this.ttlAutopurge){const i=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),s+1);i.unref&&i.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const s=()=>{const s=i.now();if(this.ttlResolution>0){t=s;const i=setTimeout((()=>t=0),this.ttlResolution);i.unref&&i.unref()}return s};this.isStale=i=>0!==this.ttls[i]&&0!==this.starts[i]&&(t||s())-this.starts[i]>this.ttls[i]}updateItemAge(t){}setItemTTL(t,i){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new r(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.addItemSize=(t,i,s,e,h)=>{const l=e||(h?h(i,s):0);this.sizes[t]=n(l)?l:0;const o=this.maxSize-this.sizes[t];for(;this.calculatedSize>o;)this.evict();this.calculatedSize+=this.sizes[t]},this.delete=t=>{if(0!==this.size){const i=this.keyMap.get(t);void 0!==i&&(this.calculatedSize-=this.sizes[i])}return d.prototype.delete.call(this,t)}}removeItemSize(t){}addItemSize(t,i,s,e,h){}*indexes(){if(this.size)for(let t=this.tail;this.isStale(t)||(yield t),t!==this.head;t=this.prev[t]);}*rindexes(){if(this.size)for(let t=this.head;this.isStale(t)||(yield t),t!==this.tail;t=this.next[t]);}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,i={}){for(const s of this.indexes())if(t(this.valList[s],this.keyList[s],this))return this.get(this.keyList[s],i)}forEach(t,i=this){for(const s of this.indexes())t.call(i,this.valList[s],this.keyList[s],this)}rforEach(t,i=this){for(const s of this.rindexes())t.call(i,this.valList[s],this.keyList[s],this)}get prune(){return h("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;if(this.size)for(let i=this.head;;i=this.next[i]){const s=i===this.tail;if(this.isStale(i)&&(this.delete(this.keyList[i]),t=!0),s)break}return t}dump(){const t=[];for(const i of this.indexes()){const s=this.keyList[i],e={value:this.valList[i]};this.ttls&&(e.ttl=this.ttls[i]),this.sizes&&(e.size=this.sizes[i]),t.unshift([s,e])}return t}load(t){this.clear();for(const[i,s]of t)this.set(i,s.value,s)}dispose(t,i,s){}set(t,i,{ttl:s=this.ttl,noDisposeOnSet:e=this.noDisposeOnSet,size:h=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:o=this.noUpdateTTL}={}){let n=0===this.size?void 0:this.keyMap.get(t);if(void 0===n)n=this.newIndex(),this.keyList[n]=t,this.valList[n]=i,this.keyMap.set(t,n),this.next[this.tail]=n,this.prev[n]=this.tail,this.tail=n,this.size++,this.addItemSize(n,i,t,h,l),o=!1;else{const s=this.valList[n];i!==s&&(e||(this.dispose(s,t,"set"),this.disposeAfter&&this.disposed.push([s,t,"set"])),this.removeItemSize(n),this.valList[n]=i,this.addItemSize(n,i,t,h,l)),this.moveToTail(n)}if(0===s||0!==this.ttl||this.ttls||this.initializeTTLTracking(),o||this.setItemTTL(n,s),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max?this.evict():0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(),t}}evict(){const t=this.head,i=this.keyList[t],s=this.valList[t];return this.dispose(s,i,"evict"),this.disposeAfter&&this.disposed.push([s,i,"evict"]),this.removeItemSize(t),this.head=this.next[t],this.keyMap.delete(i),this.size--,t}has(t){return this.keyMap.has(t)&&!this.isStale(this.keyMap.get(t))}peek(t,{allowStale:i=this.allowStale}={}){const s=this.keyMap.get(t);if(void 0!==s&&(i||!this.isStale(s)))return this.valList[s]}get(t,{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet}={}){const e=this.keyMap.get(t);if(void 0!==e){if(this.isStale(e)){const s=i?this.valList[e]:void 0;return this.delete(t),s}return this.moveToTail(e),s&&this.updateItemAge(e),this.valList[e]}}connect(t,i){this.prev[i]=t,this.next[t]=i}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return h("del","delete"),this.delete}delete(t){let i=!1;if(0!==this.size){const s=this.keyMap.get(t);void 0!==s&&(i=!0,1===this.size?this.clear():(this.removeItemSize(s),this.dispose(this.valList[s],t,"delete"),this.disposeAfter&&this.disposed.push([this.valList[s],t,"delete"]),this.keyMap.delete(t),this.keyList[s]=null,this.valList[s]=null,s===this.tail?this.tail=this.prev[s]:s===this.head?this.head=this.next[s]:(this.next[this.prev[s]]=this.next[s],this.prev[this.next[s]]=this.prev[s]),this.size--,this.free.push(s)))}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return i}clear(){if(this.dispose!==d.prototype.dispose)for(const t of this.rindexes())this.dispose(this.valList[t],this.keyList[t],"delete");if(this.disposeAfter)for(const t of this.rindexes())this.disposed.push([this.valList[t],this.keyList[t],"delete"]);if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),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,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return h("reset","clear"),this.clear}get length(){return((t,i)=>{const s="LRU_CACHE_PROPERTY_length";if(l(s)){const{prototype:i}=d,{get:e}=Object.getOwnPropertyDescriptor(i,t);o(s,"length property","cache.size",e)}})("length"),this.size}}t.exports=d}},i={},s=function s(e){var h=i[e];if(void 0!==h)return h.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,s),l.exports}(10);module.exports=s})(); \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/lru-cache/bundle/main.mjs b/node_modules/@npmcli/git/node_modules/lru-cache/bundle/main.mjs deleted file mode 100644 index 3a4d674c07a41..0000000000000 --- a/node_modules/@npmcli/git/node_modules/lru-cache/bundle/main.mjs +++ /dev/null @@ -1 +0,0 @@ -var t={10:t=>{const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=new Set,e=(t,i)=>{const s=`LRU_CACHE_OPTION_${t}`;l(s)&&o(s,`${t} option`,`options.${i}`,d)},h=(t,i)=>{const s=`LRU_CACHE_METHOD_${t}`;if(l(s)){const{prototype:e}=d,{get:h}=Object.getOwnPropertyDescriptor(e,t);o(s,`${t} method`,`cache.${i}()`,h)}},l=t=>!(process.noDeprecation||s.has(t)),o=(t,i,e,h)=>{s.add(t),process.emitWarning(`The ${i} is deprecated. Please use ${e} instead.`,"DeprecationWarning",t,h)},n=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),a=t=>n(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?r:null:null;class r extends Array{constructor(t){super(t),this.fill(0)}}class p{constructor(t){const i=a(t);this.heap=new i(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class d{constructor(t={}){const{max:i,ttl:s,ttlResolution:h=1,ttlAutopurge:l,updateAgeOnGet:o,allowStale:r,dispose:c,disposeAfter:f,noDisposeOnSet:u,noUpdateTTL:z,maxSize:v,sizeCalculation:y}=t,{length:g,maxAge:m,stale:S}=t instanceof d?{}:t;if(!n(i))throw new TypeError("max option must be an integer");const L=a(i);if(!L)throw new Error("invalid max value: "+i);if(this.max=i,this.maxSize=v||0,this.sizeCalculation=y||g,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculating set to non-function")}if(this.keyMap=new Map,this.keyList=new Array(i).fill(null),this.valList=new Array(i).fill(null),this.next=new L(i),this.prev=new L(i),this.head=0,this.tail=0,this.free=new p(i),this.initialFill=1,this.size=0,"function"==typeof c&&(this.dispose=c),"function"==typeof f?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!z,this.maxSize){if(!n(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!r||!!S,this.updateAgeOnGet=!!o,this.ttlResolution=n(h)||0===h?h:1,this.ttlAutopurge=!!l,this.ttl=s||m||0,this.ttl){if(!n(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}S&&e("stale","allowStale"),m&&e("maxAge","ttl"),g&&e("length","sizeCalculation")}initializeTTLTracking(){this.ttls=new r(this.max),this.starts=new r(this.max),this.setItemTTL=(t,s)=>{if(this.starts[t]=0!==s?i.now():0,this.ttls[t]=s,0!==s&&this.ttlAutopurge){const i=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),s+1);i.unref&&i.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const s=()=>{const s=i.now();if(this.ttlResolution>0){t=s;const i=setTimeout((()=>t=0),this.ttlResolution);i.unref&&i.unref()}return s};this.isStale=i=>0!==this.ttls[i]&&0!==this.starts[i]&&(t||s())-this.starts[i]>this.ttls[i]}updateItemAge(t){}setItemTTL(t,i){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new r(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.addItemSize=(t,i,s,e,h)=>{const l=e||(h?h(i,s):0);this.sizes[t]=n(l)?l:0;const o=this.maxSize-this.sizes[t];for(;this.calculatedSize>o;)this.evict();this.calculatedSize+=this.sizes[t]},this.delete=t=>{if(0!==this.size){const i=this.keyMap.get(t);void 0!==i&&(this.calculatedSize-=this.sizes[i])}return d.prototype.delete.call(this,t)}}removeItemSize(t){}addItemSize(t,i,s,e,h){}*indexes(){if(this.size)for(let t=this.tail;this.isStale(t)||(yield t),t!==this.head;t=this.prev[t]);}*rindexes(){if(this.size)for(let t=this.head;this.isStale(t)||(yield t),t!==this.tail;t=this.next[t]);}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,i={}){for(const s of this.indexes())if(t(this.valList[s],this.keyList[s],this))return this.get(this.keyList[s],i)}forEach(t,i=this){for(const s of this.indexes())t.call(i,this.valList[s],this.keyList[s],this)}rforEach(t,i=this){for(const s of this.rindexes())t.call(i,this.valList[s],this.keyList[s],this)}get prune(){return h("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;if(this.size)for(let i=this.head;;i=this.next[i]){const s=i===this.tail;if(this.isStale(i)&&(this.delete(this.keyList[i]),t=!0),s)break}return t}dump(){const t=[];for(const i of this.indexes()){const s=this.keyList[i],e={value:this.valList[i]};this.ttls&&(e.ttl=this.ttls[i]),this.sizes&&(e.size=this.sizes[i]),t.unshift([s,e])}return t}load(t){this.clear();for(const[i,s]of t)this.set(i,s.value,s)}dispose(t,i,s){}set(t,i,{ttl:s=this.ttl,noDisposeOnSet:e=this.noDisposeOnSet,size:h=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:o=this.noUpdateTTL}={}){let n=0===this.size?void 0:this.keyMap.get(t);if(void 0===n)n=this.newIndex(),this.keyList[n]=t,this.valList[n]=i,this.keyMap.set(t,n),this.next[this.tail]=n,this.prev[n]=this.tail,this.tail=n,this.size++,this.addItemSize(n,i,t,h,l),o=!1;else{const s=this.valList[n];i!==s&&(e||(this.dispose(s,t,"set"),this.disposeAfter&&this.disposed.push([s,t,"set"])),this.removeItemSize(n),this.valList[n]=i,this.addItemSize(n,i,t,h,l)),this.moveToTail(n)}if(0===s||0!==this.ttl||this.ttls||this.initializeTTLTracking(),o||this.setItemTTL(n,s),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max?this.evict():0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(),t}}evict(){const t=this.head,i=this.keyList[t],s=this.valList[t];return this.dispose(s,i,"evict"),this.disposeAfter&&this.disposed.push([s,i,"evict"]),this.removeItemSize(t),this.head=this.next[t],this.keyMap.delete(i),this.size--,t}has(t){return this.keyMap.has(t)&&!this.isStale(this.keyMap.get(t))}peek(t,{allowStale:i=this.allowStale}={}){const s=this.keyMap.get(t);if(void 0!==s&&(i||!this.isStale(s)))return this.valList[s]}get(t,{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet}={}){const e=this.keyMap.get(t);if(void 0!==e){if(this.isStale(e)){const s=i?this.valList[e]:void 0;return this.delete(t),s}return this.moveToTail(e),s&&this.updateItemAge(e),this.valList[e]}}connect(t,i){this.prev[i]=t,this.next[t]=i}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return h("del","delete"),this.delete}delete(t){let i=!1;if(0!==this.size){const s=this.keyMap.get(t);void 0!==s&&(i=!0,1===this.size?this.clear():(this.removeItemSize(s),this.dispose(this.valList[s],t,"delete"),this.disposeAfter&&this.disposed.push([this.valList[s],t,"delete"]),this.keyMap.delete(t),this.keyList[s]=null,this.valList[s]=null,s===this.tail?this.tail=this.prev[s]:s===this.head?this.head=this.next[s]:(this.next[this.prev[s]]=this.next[s],this.prev[this.next[s]]=this.prev[s]),this.size--,this.free.push(s)))}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return i}clear(){if(this.dispose!==d.prototype.dispose)for(const t of this.rindexes())this.dispose(this.valList[t],this.keyList[t],"delete");if(this.disposeAfter)for(const t of this.rindexes())this.disposed.push([this.valList[t],this.keyList[t],"delete"]);if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),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,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return h("reset","clear"),this.clear}get length(){return((t,i)=>{const s="LRU_CACHE_PROPERTY_length";if(l(s)){const{prototype:i}=d,{get:e}=Object.getOwnPropertyDescriptor(i,t);o(s,"length property","cache.size",e)}})("length"),this.size}}t.exports=d}},i={};!function s(e){var h=i[e];if(void 0!==h)return h.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,s),l.exports}(10); \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/lru-cache/index.js b/node_modules/@npmcli/git/node_modules/lru-cache/index.js deleted file mode 100644 index e9b2f37013e72..0000000000000 --- a/node_modules/@npmcli/git/node_modules/lru-cache/index.js +++ /dev/null @@ -1,587 +0,0 @@ -const perf = typeof performance === 'object' && performance && - typeof performance.now === 'function' ? performance : Date - -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) => !(process.noDeprecation || warned.has(code)) -const warn = (code, what, instead, fn) => { - warned.add(code) - process.emitWarning(`The ${what} is deprecated. Please use ${instead} instead.`, '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 = getUintArray(max) - 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, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize, - sizeCalculation, - } = 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 (!isPosInt(max)) { - throw new TypeError('max option must be an integer') - } - - const UintArray = getUintArray(max) - if (!UintArray) { - throw new Error('invalid max value: ' + max) - } - - this.max = max - this.maxSize = maxSize || 0 - 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('sizeCalculating set to non-function') - } - } - 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) { - 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() - } - - if (stale) { - deprecatedOption('stale', 'allowStale') - } - if (maxAge) { - deprecatedOption('maxAge', 'ttl') - } - if (length) { - deprecatedOption('length', 'sizeCalculation') - } - } - - 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.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.addItemSize = (index, v, k, size, sizeCalculation) => { - const s = size || (sizeCalculation ? sizeCalculation(v, k) : 0) - this.sizes[index] = isPosInt(s) ? s : 0 - 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, sizeCalculation) {} - - *indexes () { - if (this.size) { - for (let i = this.tail; true; i = this.prev[i]) { - if (!this.isStale(i)) { - yield i - } - if (i === this.head) { - break - } - } - } - } - *rindexes () { - if (this.size) { - for (let i = this.head; true; i = this.next[i]) { - if (!this.isStale(i)) { - yield i - } - if (i === this.tail) { - break - } - } - } - } - - *entries () { - for (const i of this.indexes()) { - yield [this.keyList[i], this.valList[i]] - } - } - - *keys () { - for (const i of this.indexes()) { - yield this.keyList[i] - } - } - - *values () { - for (const i of this.indexes()) { - 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 - if (this.size) { - for (let i = this.head; true; i = this.next[i]) { - const b = i === this.tail - if (this.isStale(i)) { - this.delete(this.keyList[i]) - deleted = true - } - if (b) { - break - } - } - } - 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, - } = {}) { - 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, sizeCalculation) - noUpdateTTL = false - } else { - // update - const oldVal = this.valList[index] - if (v !== oldVal) { - 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, sizeCalculation) - } - 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] - 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] - } - } - - get (k, { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined) { - if (this.isStale(index)) { - const value = allowStale ? this.valList[index] : undefined - this.delete(k) - return value - } else { - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return this.valList[index] - } - } - } - - 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) - this.dispose(this.valList[index], k, 'delete') - if (this.disposeAfter) { - this.disposed.push([this.valList[index], 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 () { - if (this.dispose !== LRUCache.prototype.dispose) { - for (const index of this.rindexes()) { - this.dispose(this.valList[index], this.keyList[index], 'delete') - } - } - if (this.disposeAfter) { - for (const index of this.rindexes()) { - this.disposed.push([this.valList[index], this.keyList[index], '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 diff --git a/node_modules/@npmcli/git/node_modules/lru-cache/package.json b/node_modules/@npmcli/git/node_modules/lru-cache/package.json deleted file mode 100644 index ae92116975dc9..0000000000000 --- a/node_modules/@npmcli/git/node_modules/lru-cache/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "7.4.0", - "author": "Isaac Z. Schlueter ", - "keywords": [ - "mru", - "lru", - "cache" - ], - "scripts": { - "prepare": "webpack-cli -o bundle ./index.js --node-env production", - "build": "npm run prepare", - "presize": "npm run prepare", - "test": "tap", - "snap": "tap", - "size": "size-limit", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" - }, - "main": "index.js", - "browser": "./bundle/main.js", - "exports": { - ".": "./index.js", - "./browser": "./bundle/main.js" - }, - "repository": "git://github.com/isaacs/node-lru-cache.git", - "devDependencies": { - "@size-limit/preset-small-lib": "^7.0.8", - "benchmark": "^2.1.4", - "size-limit": "^7.0.8", - "tap": "^15.1.6", - "webpack-cli": "^4.9.2" - }, - "license": "ISC", - "files": [ - "index.js", - "bundle" - ], - "engines": { - "node": ">=12" - }, - "tap": { - "coverage-map": "map.js" - }, - "size-limit": [ - { - "path": "./bundle/main.js" - } - ] -} diff --git a/node_modules/@npmcli/metavuln-calculator/package.json b/node_modules/@npmcli/metavuln-calculator/package.json index 385a34b85af27..6c05ee529cc82 100644 --- a/node_modules/@npmcli/metavuln-calculator/package.json +++ b/node_modules/@npmcli/metavuln-calculator/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/metavuln-calculator", - "version": "3.0.0", + "version": "3.0.1", "main": "lib/index.js", "files": [ "bin", @@ -29,20 +29,20 @@ "coverage-map": "map.js" }, "devDependencies": { - "@npmcli/template-oss": "^2.7.1", + "@npmcli/template-oss": "^2.9.2", "require-inject": "^1.4.4", "tap": "^15.1.6" }, "dependencies": { - "cacache": "^15.3.0", + "cacache": "^16.0.0", "json-parse-even-better-errors": "^2.3.1", - "pacote": "^13.0.1", + "pacote": "^13.0.3", "semver": "^7.3.5" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" }, "templateOSS": { - "version": "2.7.1" + "version": "2.9.2" } } diff --git a/node_modules/cacache/lib/content/read.js b/node_modules/cacache/lib/content/read.js index 034e8eee05b10..8bffb2af83cab 100644 --- a/node_modules/cacache/lib/content/read.js +++ b/node_modules/cacache/lib/content/read.js @@ -20,15 +20,18 @@ function read (cache, integrity, opts = {}) { // get size return lstat(cpath).then(stat => ({ stat, cpath, sri })) }).then(({ stat, cpath, sri }) => { - if (typeof size === 'number' && stat.size !== size) + if (typeof size === 'number' && stat.size !== size) { throw sizeError(size, stat.size) + } - if (stat.size > MAX_SINGLE_READ_SIZE) + if (stat.size > MAX_SINGLE_READ_SIZE) { return readPipeline(cpath, stat.size, sri, new Pipeline()).concat() + } return readFile(cpath, null).then((data) => { - if (!ssri.checkData(data, sri)) + if (!ssri.checkData(data, sri)) { throw integrityError(sri, cpath) + } return data }) @@ -55,11 +58,13 @@ function readSync (cache, integrity, opts = {}) { const { size } = opts return withContentSriSync(cache, integrity, (cpath, sri) => { const data = fs.readFileSync(cpath) - if (typeof size === 'number' && size !== data.length) + if (typeof size === 'number' && size !== data.length) { throw sizeError(size, data.length) + } - if (ssri.checkData(data, sri)) + if (ssri.checkData(data, sri)) { return data + } throw integrityError(sri, cpath) }) @@ -75,8 +80,9 @@ function readStream (cache, integrity, opts = {}) { // just lstat to ensure it exists return lstat(cpath).then((stat) => ({ stat, cpath, sri })) }).then(({ stat, cpath, sri }) => { - if (typeof size === 'number' && size !== stat.size) + if (typeof size === 'number' && size !== stat.size) { return stream.emit('error', sizeError(size, stat.size)) + } readPipeline(cpath, stat.size, sri, stream) }, er => stream.emit('error', er)) @@ -106,21 +112,24 @@ function copySync (cache, integrity, dest) { module.exports.hasContent = hasContent function hasContent (cache, integrity) { - if (!integrity) + if (!integrity) { return Promise.resolve(false) + } return withContentSri(cache, integrity, (cpath, sri) => { return lstat(cpath).then((stat) => ({ size: stat.size, sri, stat })) }).catch((err) => { - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return false + } if (err.code === 'EPERM') { /* istanbul ignore else */ - if (process.platform !== 'win32') + if (process.platform !== 'win32') { throw err - else + } else { return false + } } }) } @@ -128,23 +137,26 @@ function hasContent (cache, integrity) { module.exports.hasContent.sync = hasContentSync function hasContentSync (cache, integrity) { - if (!integrity) + if (!integrity) { return false + } return withContentSriSync(cache, integrity, (cpath, sri) => { try { const stat = fs.lstatSync(cpath) return { size: stat.size, sri, stat } } catch (err) { - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return false + } if (err.code === 'EPERM') { /* istanbul ignore else */ - if (process.platform !== 'win32') + if (process.platform !== 'win32') { throw err - else + } else { return false + } } } }) @@ -180,13 +192,15 @@ function withContentSri (cache, integrity, fn) { .then((results) => { // Return the first non error if it is found const result = results.find((r) => !(r instanceof Error)) - if (result) + if (result) { return result + } // Throw the No matching content found error const enoentError = results.find((r) => r.code === 'ENOENT') - if (enoentError) + if (enoentError) { throw enoentError + } // Throw generic error throw results.find((r) => r instanceof Error) @@ -228,6 +242,7 @@ function withContentSriSync (cache, integrity, fn) { } function sizeError (expected, found) { + /* eslint-disable-next-line max-len */ const err = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`) err.expected = expected err.found = found diff --git a/node_modules/cacache/lib/content/rm.js b/node_modules/cacache/lib/content/rm.js index 6a3d1a3d02340..50612364e9b48 100644 --- a/node_modules/cacache/lib/content/rm.js +++ b/node_modules/cacache/lib/content/rm.js @@ -11,9 +11,10 @@ module.exports = rm function rm (cache, integrity) { return hasContent(cache, integrity).then((content) => { // ~pretty~ sure we can't end up with a content lacking sri, but be safe - if (content && content.sri) + if (content && content.sri) { return rimraf(contentPath(cache, content.sri)).then(() => true) - else + } else { return false + } }) } diff --git a/node_modules/cacache/lib/content/write.js b/node_modules/cacache/lib/content/write.js index dde1bd1dd5dae..a71e81ad5e150 100644 --- a/node_modules/cacache/lib/content/write.js +++ b/node_modules/cacache/lib/content/write.js @@ -22,15 +22,18 @@ module.exports = write function write (cache, data, opts = {}) { const { algorithms, size, integrity } = opts - if (algorithms && algorithms.length > 1) + if (algorithms && algorithms.length > 1) { throw new Error('opts.algorithms only supports a single algorithm for now') + } - if (typeof size === 'number' && data.length !== size) + if (typeof size === 'number' && data.length !== size) { return Promise.reject(sizeError(size, data.length)) + } const sri = ssri.fromData(data, algorithms ? { algorithms } : {}) - if (integrity && !ssri.checkData(data, integrity, opts)) + if (integrity && !ssri.checkData(data, integrity, opts)) { return Promise.reject(checksumError(integrity, sri)) + } return disposer(makeTmp(cache, opts), makeTmpDisposer, (tmp) => { @@ -149,8 +152,9 @@ function makeTmp (cache, opts) { } function makeTmpDisposer (tmp) { - if (tmp.moved) + if (tmp.moved) { return Promise.resolve() + } return rimraf(tmp.target) } @@ -171,6 +175,7 @@ function moveToDestination (tmp, cache, sri, opts) { } function sizeError (expected, found) { + /* eslint-disable-next-line max-len */ const err = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`) err.expected = expected err.found = found diff --git a/node_modules/cacache/lib/entry-index.js b/node_modules/cacache/lib/entry-index.js index 71aac5ed75b14..426778b850963 100644 --- a/node_modules/cacache/lib/entry-index.js +++ b/node_modules/cacache/lib/entry-index.js @@ -49,8 +49,9 @@ async function compact (cache, key, matchFn, opts = {}) { // if the integrity is null and no validateEntry is provided, we break // as we consider the null integrity to be a deletion of everything // that came before it. - if (entry.integrity === null && !opts.validateEntry) + if (entry.integrity === null && !opts.validateEntry) { break + } // if this entry is valid, and it is either the first entry or // the newEntries array doesn't already include an entry that @@ -58,8 +59,9 @@ async function compact (cache, key, matchFn, opts = {}) { // it to the beginning of our list if ((!opts.validateEntry || opts.validateEntry(entry) === true) && (newEntries.length === 0 || - !newEntries.find((oldEntry) => matchFn(oldEntry, entry)))) + !newEntries.find((oldEntry) => matchFn(oldEntry, entry)))) { newEntries.unshift(entry) + } } const newIndex = '\n' + newEntries.map((entry) => { @@ -78,8 +80,9 @@ async function compact (cache, key, matchFn, opts = {}) { } const teardown = async (tmp) => { - if (!tmp.moved) + if (!tmp.moved) { return rimraf(tmp.target) + } } const write = async (tmp) => { @@ -92,8 +95,9 @@ async function compact (cache, key, matchFn, opts = {}) { try { await fixOwner.chownr(cache, bucket) } catch (err) { - if (err.code !== 'ENOENT') + if (err.code !== 'ENOENT') { throw err + } } } @@ -136,8 +140,9 @@ function insert (cache, key, integrity, opts = {}) { }) .then(() => fixOwner.chownr(cache, bucket)) .catch((err) => { - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return undefined + } throw err // There's a class of race conditions that happen when things get deleted @@ -169,8 +174,9 @@ function insertSync (cache, key, integrity, opts = {}) { try { fixOwner.chownr.sync(cache, bucket) } catch (err) { - if (err.code !== 'ENOENT') + if (err.code !== 'ENOENT') { throw err + } } return formatEntry(cache, entry) } @@ -182,17 +188,19 @@ function find (cache, key) { return bucketEntries(bucket) .then((entries) => { return entries.reduce((latest, next) => { - if (next && next.key === key) + if (next && next.key === key) { return formatEntry(cache, next) - else + } else { return latest + } }, null) }) .catch((err) => { - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return null - else + } else { throw err + } }) } @@ -202,24 +210,27 @@ function findSync (cache, key) { const bucket = bucketPath(cache, key) try { return bucketEntriesSync(bucket).reduce((latest, next) => { - if (next && next.key === key) + if (next && next.key === key) { return formatEntry(cache, next) - else + } else { return latest + } }, null) } catch (err) { - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return null - else + } else { throw err + } } } module.exports.delete = del function del (cache, key, opts = {}) { - if (!opts.removeFully) + if (!opts.removeFully) { return insert(cache, key, null, opts) + } const bucket = bucketPath(cache, key) return rimraf(bucket) @@ -228,8 +239,9 @@ function del (cache, key, opts = {}) { module.exports.delete.sync = delSync function delSync (cache, key, opts = {}) { - if (!opts.removeFully) + if (!opts.removeFully) { return insertSync(cache, key, null, opts) + } const bucket = bucketPath(cache, key) return rimraf.sync(bucket) @@ -263,12 +275,14 @@ function lsStream (cache) { // reduced is a map of key => entry for (const entry of reduced.values()) { const formatted = formatEntry(cache, entry) - if (formatted) + if (formatted) { stream.write(formatted) + } } }).catch(err => { - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return undefined + } throw err }) }) @@ -312,8 +326,9 @@ function bucketEntriesSync (bucket, filter) { function _bucketEntries (data, filter) { const entries = [] data.split('\n').forEach((entry) => { - if (!entry) + if (!entry) { return + } const pieces = entry.split('\t') if (!pieces[1] || hashEntry(pieces[1]) !== pieces[0]) { @@ -328,8 +343,9 @@ function _bucketEntries (data, filter) { // Entry is corrupted! return } - if (obj) + if (obj) { entries.push(obj) + } }) return entries } @@ -371,8 +387,9 @@ function hash (str, digest) { function formatEntry (cache, entry, keepAll) { // Treat null digests as deletions. They'll shadow any previous entries. - if (!entry.integrity && !keepAll) + if (!entry.integrity && !keepAll) { return null + } return { key: entry.key, @@ -386,8 +403,9 @@ function formatEntry (cache, entry, keepAll) { function readdirOrEmpty (dir) { return readdir(dir).catch((err) => { - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') { return [] + } throw err }) diff --git a/node_modules/cacache/get.js b/node_modules/cacache/lib/get.js similarity index 91% rename from node_modules/cacache/get.js rename to node_modules/cacache/lib/get.js index 4e905e7cf861c..d9d4bf4c6416f 100644 --- a/node_modules/cacache/get.js +++ b/node_modules/cacache/lib/get.js @@ -6,9 +6,9 @@ const Pipeline = require('minipass-pipeline') const fs = require('fs') const util = require('util') -const index = require('./lib/entry-index') -const memo = require('./lib/memoization') -const read = require('./lib/content/read') +const index = require('./entry-index') +const memo = require('./memoization') +const read = require('./content/read') const writeFile = util.promisify(fs.writeFile) @@ -25,12 +25,14 @@ function getData (cache, key, opts = {}) { } return index.find(cache, key, opts).then((entry) => { - if (!entry) + if (!entry) { throw new index.NotFoundError(cache, key) + } return read(cache, entry.integrity, { integrity, size }).then((data) => { - if (memoize) + if (memoize) { memo.put(cache, entry, data, opts) + } return { data, @@ -46,12 +48,14 @@ module.exports = getData function getDataByDigest (cache, key, opts = {}) { const { integrity, memoize, size } = opts const memoized = memo.get.byDigest(cache, key, opts) - if (memoized && memoize !== false) + if (memoized && memoize !== false) { return Promise.resolve(memoized) + } return read(cache, key, { integrity, size }).then((res) => { - if (memoize) + if (memoize) { memo.put.byDigest(cache, key, res, opts) + } return res }) } @@ -70,8 +74,9 @@ function getDataSync (cache, key, opts = {}) { } } const entry = index.find.sync(cache, key, opts) - if (!entry) + if (!entry) { throw new index.NotFoundError(cache, key) + } const data = read.sync(cache, entry.integrity, { integrity: integrity, size: size, @@ -82,8 +87,9 @@ function getDataSync (cache, key, opts = {}) { size: entry.size, integrity: entry.integrity, } - if (memoize) + if (memoize) { memo.put(cache, entry, res.data, opts) + } return res } @@ -94,15 +100,17 @@ function getDataByDigestSync (cache, digest, opts = {}) { const { integrity, memoize, size } = opts const memoized = memo.get.byDigest(cache, digest, opts) - if (memoized && memoize !== false) + if (memoized && memoize !== false) { return memoized + } const res = read.sync(cache, digest, { integrity: integrity, size: size, }) - if (memoize) + if (memoize) { memo.put.byDigest(cache, digest, res, opts) + } return res } @@ -122,15 +130,17 @@ const getMemoizedStream = (memoized) => { function getStream (cache, key, opts = {}) { const { memoize, size } = opts const memoized = memo.get(cache, key, opts) - if (memoized && memoize !== false) + if (memoized && memoize !== false) { return getMemoizedStream(memoized) + } const stream = new Pipeline() index .find(cache, key) .then((entry) => { - if (!entry) + if (!entry) { throw new index.NotFoundError(cache, key) + } stream.emit('metadata', entry.metadata) stream.emit('integrity', entry.integrity) @@ -170,8 +180,9 @@ function getStreamDigest (cache, integrity, opts = {}) { return stream } else { const stream = read.readStream(cache, integrity, opts) - if (!memoize) + if (!memoize) { return stream + } const memoStream = new Collect.PassThrough() memoStream.on('collect', data => memo.put.byDigest( @@ -189,18 +200,20 @@ module.exports.stream.byDigest = getStreamDigest function info (cache, key, opts = {}) { const { memoize } = opts const memoized = memo.get(cache, key, opts) - if (memoized && memoize !== false) + if (memoized && memoize !== false) { return Promise.resolve(memoized.entry) - else + } else { return index.find(cache, key) + } } module.exports.info = info function copy (cache, key, dest, opts = {}) { if (read.copy) { return index.find(cache, key, opts).then((entry) => { - if (!entry) + if (!entry) { throw new index.NotFoundError(cache, key) + } return read.copy(cache, entry.integrity, dest, opts) .then(() => { return { @@ -225,8 +238,9 @@ function copy (cache, key, dest, opts = {}) { module.exports.copy = copy function copyByDigest (cache, key, dest, opts = {}) { - if (read.copy) + if (read.copy) { return read.copy(cache, key, dest, opts).then(() => key) + } return getDataByDigest(cache, key, opts).then((res) => { return writeFile(dest, res).then(() => key) diff --git a/node_modules/cacache/index.js b/node_modules/cacache/lib/index.js similarity index 83% rename from node_modules/cacache/index.js rename to node_modules/cacache/lib/index.js index c8c52b0417dea..1c56be68dd8fd 100644 --- a/node_modules/cacache/index.js +++ b/node_modules/cacache/lib/index.js @@ -1,20 +1,19 @@ 'use strict' -const ls = require('./ls.js') const get = require('./get.js') const put = require('./put.js') const rm = require('./rm.js') const verify = require('./verify.js') -const { clearMemoized } = require('./lib/memoization.js') -const tmp = require('./lib/util/tmp.js') -const index = require('./lib/entry-index.js') +const { clearMemoized } = require('./memoization.js') +const tmp = require('./util/tmp.js') +const index = require('./entry-index.js') module.exports.index = {} module.exports.index.compact = index.compact module.exports.index.insert = index.insert -module.exports.ls = ls -module.exports.ls.stream = ls.stream +module.exports.ls = index.ls +module.exports.ls.stream = index.lsStream module.exports.get = get module.exports.get.byDigest = get.byDigest diff --git a/node_modules/cacache/lib/memoization.js b/node_modules/cacache/lib/memoization.js index d5465f39fc581..cd25f2013b4af 100644 --- a/node_modules/cacache/lib/memoization.js +++ b/node_modules/cacache/lib/memoization.js @@ -2,13 +2,11 @@ const LRU = require('lru-cache') -const MAX_SIZE = 50 * 1024 * 1024 // 50MB -const MAX_AGE = 3 * 60 * 1000 - const MEMOIZED = new LRU({ - max: MAX_SIZE, - maxAge: MAX_AGE, - length: (entry, key) => key.startsWith('key:') ? entry.data.length : entry.length, + max: 500, + maxSize: 50 * 1024 * 1024, // 50MB + ttl: 3 * 60 * 1000, // 3 minutes + sizeCalculation: (entry, key) => key.startsWith('key:') ? entry.data.length : entry.length, }) module.exports.clearMemoized = clearMemoized @@ -62,12 +60,13 @@ class ObjProxy { } function pickMem (opts) { - if (!opts || !opts.memoize) + if (!opts || !opts.memoize) { return MEMOIZED - else if (opts.memoize.get && opts.memoize.set) + } else if (opts.memoize.get && opts.memoize.set) { return opts.memoize - else if (typeof opts.memoize === 'object') + } else if (typeof opts.memoize === 'object') { return new ObjProxy(opts.memoize) - else + } else { return MEMOIZED + } } diff --git a/node_modules/cacache/put.js b/node_modules/cacache/lib/put.js similarity index 86% rename from node_modules/cacache/put.js rename to node_modules/cacache/lib/put.js index 84e9562bc33ab..d6904fa301272 100644 --- a/node_modules/cacache/put.js +++ b/node_modules/cacache/lib/put.js @@ -1,8 +1,8 @@ 'use strict' -const index = require('./lib/entry-index') -const memo = require('./lib/memoization') -const write = require('./lib/content/write') +const index = require('./entry-index') +const memo = require('./memoization') +const write = require('./content/write') const Flush = require('minipass-flush') const { PassThrough } = require('minipass-collect') const Pipeline = require('minipass-pipeline') @@ -21,8 +21,9 @@ function putData (cache, key, data, opts = {}) { return index .insert(cache, key, res.integrity, { ...opts, size: res.size }) .then((entry) => { - if (memoize) + if (memoize) { memo.put(cache, entry, data, opts) + } return res.integrity }) @@ -67,14 +68,17 @@ function putStream (cache, key, opts = {}) { return index .insert(cache, key, integrity, { ...opts, size }) .then((entry) => { - if (memoize && memoData) + if (memoize && memoData) { memo.put(cache, entry, memoData, opts) + } - if (integrity) + if (integrity) { pipeline.emit('integrity', integrity) + } - if (size) + if (size) { pipeline.emit('size', size) + } }) }, })) diff --git a/node_modules/cacache/rm.js b/node_modules/cacache/lib/rm.js similarity index 80% rename from node_modules/cacache/rm.js rename to node_modules/cacache/lib/rm.js index f2ef6b190f457..5f00071770b8d 100644 --- a/node_modules/cacache/rm.js +++ b/node_modules/cacache/lib/rm.js @@ -2,11 +2,11 @@ const util = require('util') -const index = require('./lib/entry-index') -const memo = require('./lib/memoization') +const index = require('./entry-index') +const memo = require('./memoization') const path = require('path') const rimraf = util.promisify(require('rimraf')) -const rmContent = require('./lib/content/rm') +const rmContent = require('./content/rm') module.exports = entry module.exports.entry = entry diff --git a/node_modules/cacache/lib/util/disposer.js b/node_modules/cacache/lib/util/disposer.js index aa8aed54da551..52d7d3edda7d5 100644 --- a/node_modules/cacache/lib/util/disposer.js +++ b/node_modules/cacache/lib/util/disposer.js @@ -8,8 +8,9 @@ function disposer (creatorFn, disposerFn, fn) { .then( // disposer resolved, do something with original fn's promise () => { - if (shouldThrow) + if (shouldThrow) { throw result + } return result }, diff --git a/node_modules/cacache/lib/util/fix-owner.js b/node_modules/cacache/lib/util/fix-owner.js index 90ffece524f54..bc14def4e405c 100644 --- a/node_modules/cacache/lib/util/fix-owner.js +++ b/node_modules/cacache/lib/util/fix-owner.js @@ -49,8 +49,9 @@ function fixOwner (cache, filepath) { const { uid, gid } = owner // No need to override if it's already what we used. - if (self.uid === uid && self.gid === gid) + if (self.uid === uid && self.gid === gid) { return + } return inflight('fixOwner: fixing ownership on ' + filepath, () => chownr( @@ -58,8 +59,9 @@ function fixOwner (cache, filepath) { typeof uid === 'number' ? uid : self.uid, typeof gid === 'number' ? gid : self.gid ).catch((err) => { - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return null + } throw err }) @@ -93,8 +95,9 @@ function fixOwnerSync (cache, filepath) { ) } catch (err) { // only catch ENOENT, any other error is a problem. - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return null + } throw err } @@ -110,12 +113,14 @@ function mkdirfix (cache, p, cb) { return Promise.resolve(inferOwner(cache)).then(() => { return mkdirp(p) .then((made) => { - if (made) + if (made) { return fixOwner(cache, made).then(() => made) + } }) .catch((err) => { - if (err.code === 'EEXIST') + if (err.code === 'EEXIST') { return fixOwner(cache, p).then(() => null) + } throw err }) @@ -136,7 +141,8 @@ function mkdirfixSync (cache, p) { if (err.code === 'EEXIST') { fixOwnerSync(cache, p) return null - } else + } else { throw err + } } } diff --git a/node_modules/cacache/lib/util/move-file.js b/node_modules/cacache/lib/util/move-file.js index c3f9e35eb99c7..3739cea3df281 100644 --- a/node_modules/cacache/lib/util/move-file.js +++ b/node_modules/cacache/lib/util/move-file.js @@ -38,10 +38,12 @@ function moveFile (src, dest) { } else if (err.code === 'EEXIST' || err.code === 'EBUSY') { // file already exists, so whatever return resolve() - } else + } else { return reject(err) - } else + } + } else { return resolve() + } }) }) .then(() => { diff --git a/node_modules/cacache/lib/verify.js b/node_modules/cacache/lib/verify.js index e9d679eceaf51..300cd9f9de1c4 100644 --- a/node_modules/cacache/lib/verify.js +++ b/node_modules/cacache/lib/verify.js @@ -54,8 +54,9 @@ function verify (cache, opts) { stats[k] = s[k] }) const end = new Date() - if (!stats.runTime) + if (!stats.runTime) { stats.runTime = {} + } stats.runTime[label] = end - start return Promise.resolve(stats) @@ -108,8 +109,9 @@ function garbageCollect (cache, opts) { const indexStream = index.lsStream(cache) const liveContent = new Set() indexStream.on('data', (entry) => { - if (opts.filter && !opts.filter(entry)) + if (opts.filter && !opts.filter(entry)) { return + } liveContent.add(entry.integrity.toString()) }) @@ -176,8 +178,9 @@ function verifyContent (filepath, sri) { return ssri .checkStream(new fsm.ReadStream(filepath), sri) .catch((err) => { - if (err.code !== 'EINTEGRITY') + if (err.code !== 'EINTEGRITY') { throw err + } return rimraf(filepath).then(() => { contentInfo.valid = false @@ -186,8 +189,9 @@ function verifyContent (filepath, sri) { .then(() => contentInfo) }) .catch((err) => { - if (err.code === 'ENOENT') + if (err.code === 'ENOENT') { return { size: 0, valid: false } + } throw err }) @@ -209,9 +213,9 @@ function rebuildIndex (cache, opts) { const entry = entries[k] const excluded = opts.filter && !opts.filter(entry) excluded && stats.rejectedEntries++ - if (buckets[hashed] && !excluded) + if (buckets[hashed] && !excluded) { buckets[hashed].push(entry) - else if (buckets[hashed] && excluded) { + } else if (buckets[hashed] && excluded) { // skip } else if (excluded) { buckets[hashed] = [] diff --git a/node_modules/cacache/ls.js b/node_modules/cacache/ls.js deleted file mode 100644 index 6006c99e34852..0000000000000 --- a/node_modules/cacache/ls.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict' - -const index = require('./lib/entry-index') - -module.exports = index.ls -module.exports.stream = index.lsStream diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index 6cb4140159af8..1003230cd6363 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,14 +1,14 @@ { "name": "cacache", - "version": "15.3.0", + "version": "16.0.1", "cache-version": { "content": "2", "index": "5" }, "description": "Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.", - "main": "index.js", + "main": "lib/index.js", "files": [ - "*.js", + "bin", "lib" ], "scripts": { @@ -20,10 +20,13 @@ "snap": "tap", "coverage": "tap", "test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test", - "lint": "npm run npmclilint -- \"*.*js\" \"lib/**/*.*js\" \"test/**/*.*js\"", + "lint": "eslint '**/*.js'", "npmclilint": "npmcli-lint", "lintfix": "npm run lint -- --fix", - "postsnap": "npm run lintfix --" + "postsnap": "npm run lintfix --", + "postlint": "npm-template-check", + "template-copy": "npm-template-copy --force", + "posttest": "npm run lint" }, "repository": "https://github.com/npm/cacache", "keywords": [ @@ -44,26 +47,26 @@ "license": "ISC", "dependencies": { "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", + "@npmcli/move-file": "^1.1.2", "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", + "fs-minipass": "^2.1.0", + "glob": "^7.2.0", "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", + "lru-cache": "^7.5.1", + "minipass": "^3.1.6", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", "ssri": "^8.0.1", - "tar": "^6.0.2", + "tar": "^6.1.11", "unique-filename": "^1.1.1" }, "devDependencies": { - "@npmcli/lint": "^1.0.1", + "@npmcli/template-oss": "^2.9.2", "benchmark": "^2.1.4", "chalk": "^4.0.0", "require-inject": "^1.4.4", @@ -75,6 +78,11 @@ "test-regex": "test/[^/]*.js" }, "engines": { - "node": ">= 10" - } + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "templateOSS": { + "windowsCI": false, + "version": "2.9.2" + }, + "author": "GitHub Inc." } diff --git a/node_modules/cacache/verify.js b/node_modules/cacache/verify.js deleted file mode 100644 index db7763d7afd07..0000000000000 --- a/node_modules/cacache/verify.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('./lib/verify') diff --git a/node_modules/hosted-git-info/git-host-info.js b/node_modules/hosted-git-info/lib/git-host-info.js similarity index 98% rename from node_modules/hosted-git-info/git-host-info.js rename to node_modules/hosted-git-info/lib/git-host-info.js index ba55248e7d62d..9a9720fa3c339 100644 --- a/node_modules/hosted-git-info/git-host-info.js +++ b/node_modules/hosted-git-info/lib/git-host-info.js @@ -1,3 +1,4 @@ +/* eslint-disable max-len */ 'use strict' const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : '' const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : '' @@ -13,7 +14,7 @@ const defaults = { shortcuttemplate: ({ type, user, project, committish }) => `${type}:${user}/${project}${maybeJoin('#', committish)}`, pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin('#', committish)}`, bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`, - hashformat: formatHashFragment + hashformat: formatHashFragment, } const gitHosts = {} @@ -45,7 +46,7 @@ gitHosts.github = Object.assign({}, defaults, { } return { user, project, committish } - } + }, }) gitHosts.bitbucket = Object.assign({}, defaults, { @@ -68,7 +69,7 @@ gitHosts.bitbucket = Object.assign({}, defaults, { } return { user, project, committish: url.hash.slice(1) } - } + }, }) gitHosts.gitlab = Object.assign({}, defaults, { @@ -95,7 +96,7 @@ gitHosts.gitlab = Object.assign({}, defaults, { } return { user, project, committish: url.hash.slice(1) } - } + }, }) gitHosts.gist = Object.assign({}, defaults, { @@ -136,7 +137,7 @@ gitHosts.gist = Object.assign({}, defaults, { }, hashformat: function (fragment) { return fragment && 'file-' + formatHashFragment(fragment) - } + }, }) gitHosts.sourcehut = Object.assign({}, defaults, { @@ -166,7 +167,7 @@ gitHosts.sourcehut = Object.assign({}, defaults, { } return { user, project, committish: url.hash.slice(1) } - } + }, }) const names = Object.keys(gitHosts) diff --git a/node_modules/hosted-git-info/git-host.js b/node_modules/hosted-git-info/lib/git-host.js similarity index 100% rename from node_modules/hosted-git-info/git-host.js rename to node_modules/hosted-git-info/lib/git-host.js diff --git a/node_modules/hosted-git-info/index.js b/node_modules/hosted-git-info/lib/index.js similarity index 93% rename from node_modules/hosted-git-info/index.js rename to node_modules/hosted-git-info/lib/index.js index f35c570c46b59..8bce6b3c28d51 100644 --- a/node_modules/hosted-git-info/index.js +++ b/node_modules/hosted-git-info/lib/index.js @@ -9,7 +9,7 @@ const protocolToRepresentationMap = { 'git+ssh:': 'sshurl', 'git+https:': 'https', 'ssh:': 'sshurl', - 'git:': 'git' + 'git:': 'git', } function protocolToRepresentation (protocol) { @@ -21,10 +21,11 @@ const authProtocols = { 'https:': true, 'git+https:': true, 'http:': true, - 'git+http:': true + 'git+http:': true, } -const knownProtocols = Object.keys(gitHosts.byShortcut).concat(['http:', 'https:', 'git:', 'git+ssh:', 'git+https:', 'ssh:']) +const knownProtocols = Object.keys(gitHosts.byShortcut) + .concat(['http:', 'https:', 'git:', 'git+ssh:', 'git+https:', 'ssh:']) module.exports.fromUrl = function (giturl, opts) { if (typeof giturl !== 'string') { @@ -52,7 +53,10 @@ function fromUrl (giturl, opts) { } const gitHostShortcut = gitHosts.byShortcut[parsed.protocol] - const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith('www.') ? parsed.hostname.slice(4) : parsed.hostname] + const gitHostDomain = + gitHosts.byDomain[parsed.hostname.startsWith('www.') ? + parsed.hostname.slice(4) : + parsed.hostname] const gitHostName = gitHostShortcut || gitHostDomain if (!gitHostName) { return @@ -172,11 +176,14 @@ const isGitHubShorthand = (arg) => { const colonOnlyAfterHash = firstColon === -1 || (firstHash > -1 && firstColon > firstHash) const secondSlashOnlyAfterHash = secondSlash === -1 || (firstHash > -1 && secondSlash > firstHash) const hasSlash = firstSlash > 0 - // if a # is found, what we really want to know is that the character immediately before # is not a / + // if a # is found, what we really want to know is that the character + // immediately before # is not a / const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== '/' : !arg.endsWith('/') const doesNotStartWithDot = !arg.startsWith('.') - return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash + return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && + doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && + secondSlashOnlyAfterHash } // attempt to correct an scp style url so that it will parse with `new URL()` diff --git a/node_modules/hosted-git-info/package.json b/node_modules/hosted-git-info/package.json index b145e62240805..0153b0852cbf4 100644 --- a/node_modules/hosted-git-info/package.json +++ b/node_modules/hosted-git-info/package.json @@ -1,8 +1,8 @@ { "name": "hosted-git-info", - "version": "4.1.0", + "version": "5.0.0", "description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", - "main": "index.js", + "main": "./lib/index.js", "repository": { "type": "git", "url": "git+https://github.com/npm/hosted-git-info.git" @@ -13,39 +13,44 @@ "bitbucket", "gitlab" ], - "author": "Rebecca Turner (http://re-becca.org)", + "author": "GitHub Inc.", "license": "ISC", "bugs": { "url": "https://github.com/npm/hosted-git-info/issues" }, "homepage": "https://github.com/npm/hosted-git-info", "scripts": { - "posttest": "standard", + "posttest": "npm run lint", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "preversion": "npm test", "snap": "tap", "test": "tap", - "test:coverage": "tap --coverage-report=html" + "test:coverage": "tap --coverage-report=html", + "lint": "eslint '**/*.js'", + "postlint": "npm-template-check", + "template-copy": "npm-template-copy --force", + "lintfix": "npm run lint -- --fix" }, "dependencies": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.5.1" }, "devDependencies": { - "standard": "^16.0.3", - "standard-version": "^9.1.0", + "@npmcli/template-oss": "^2.9.2", "tap": "^15.1.6" }, "files": [ - "index.js", - "git-host.js", - "git-host-info.js" + "bin", + "lib" ], "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" }, "tap": { "color": 1, "coverage": true + }, + "templateOSS": { + "version": "2.9.2" } } diff --git a/node_modules/init-package-json/package.json b/node_modules/init-package-json/package.json index 7649c503de815..9219863cb6720 100644 --- a/node_modules/init-package-json/package.json +++ b/node_modules/init-package-json/package.json @@ -1,6 +1,6 @@ { "name": "init-package-json", - "version": "3.0.0", + "version": "3.0.1", "main": "lib/init-package-json.js", "scripts": { "test": "tap", @@ -25,14 +25,14 @@ "npm-package-arg": "^9.0.0", "promzard": "^0.3.0", "read": "^1.0.7", - "read-package-json": "^4.1.1", + "read-package-json": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^3.0.0" }, "devDependencies": { - "@npmcli/config": "^4.0.0", - "@npmcli/template-oss": "^2.7.1", + "@npmcli/config": "^4.0.1", + "@npmcli/template-oss": "^2.9.2", "tap": "^15.1.6" }, "engines": { @@ -58,6 +58,6 @@ "lib" ], "templateOSS": { - "version": "2.7.1" + "version": "2.9.2" } } diff --git a/node_modules/lru-cache/LICENSE b/node_modules/lru-cache/LICENSE index 19129e315fe59..9b58a3e03d1df 100644 --- a/node_modules/lru-cache/LICENSE +++ b/node_modules/lru-cache/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/node_modules/lru-cache/index.js b/node_modules/lru-cache/index.js index 573b6b85b9779..e37f51616452e 100644 --- a/node_modules/lru-cache/index.js +++ b/node_modules/lru-cache/index.js @@ -1,334 +1,615 @@ -'use strict' - -// A linked list to keep track of recently-used-ness -const Yallist = require('yallist') - -const MAX = Symbol('max') -const LENGTH = Symbol('length') -const LENGTH_CALCULATOR = Symbol('lengthCalculator') -const ALLOW_STALE = Symbol('allowStale') -const MAX_AGE = Symbol('maxAge') -const DISPOSE = Symbol('dispose') -const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') -const LRU_LIST = Symbol('lruList') -const CACHE = Symbol('cache') -const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') - -const naiveLength = () => 1 - -// lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. -class LRUCache { - constructor (options) { - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - if (options.max && (typeof options.max !== 'number' || options.max < 0)) - throw new TypeError('max must be a non-negative number') - // Kind of weird to have a default max of Infinity, but oh well. - const max = this[MAX] = options.max || Infinity - - const lc = options.length || naiveLength - this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc - this[ALLOW_STALE] = options.stale || false - if (options.maxAge && typeof options.maxAge !== 'number') - throw new TypeError('maxAge must be a number') - this[MAX_AGE] = options.maxAge || 0 - this[DISPOSE] = options.dispose - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false - this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false - this.reset() +const perf = typeof performance === 'object' && performance && + typeof performance.now === 'function' ? performance : Date + +const warned = new Set() +const deprecatedOption = (opt, instead) => { + const code = `LRU_CACHE_OPTION_${opt}` + if (shouldWarn(code)) { + warn(code, `${opt} option`, `options.${instead}`, LRUCache) } - - // resize the cache when the max changes. - set max (mL) { - if (typeof mL !== 'number' || mL < 0) - throw new TypeError('max must be a non-negative number') - - this[MAX] = mL || Infinity - trim(this) +} +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) } - get max () { - return this[MAX] +} +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 && + !(process.noDeprecation || warned.has(code)) +const warn = (code, what, instead, fn) => { + warned.add(code) + process.emitWarning(`The ${what} is deprecated. Please use ${instead} instead.`, 'DeprecationWarning', code, fn) +} - set allowStale (allowStale) { - this[ALLOW_STALE] = !!allowStale - } - get allowStale () { - return this[ALLOW_STALE] +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) } +} - set maxAge (mA) { - if (typeof mA !== 'number') - throw new TypeError('maxAge must be a non-negative number') - - this[MAX_AGE] = mA - trim(this) +class Stack { + constructor (max) { + const UintArray = getUintArray(max) + this.heap = new UintArray(max) + this.length = 0 } - get maxAge () { - return this[MAX_AGE] + push (n) { + this.heap[this.length++] = n } + pop () { + return this.heap[--this.length] + } +} - // resize the cache when the lengthCalculator changes. - set lengthCalculator (lC) { - if (typeof lC !== 'function') - lC = naiveLength +class LRUCache { + constructor (options = {}) { + const { + max, + ttl, + ttlResolution = 1, + ttlAutopurge, + updateAgeOnGet, + allowStale, + dispose, + disposeAfter, + noDisposeOnSet, + noUpdateTTL, + maxSize, + sizeCalculation, + } = 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 (!isPosInt(max)) { + throw new TypeError('max option must be an integer') + } - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC - this[LENGTH] = 0 - this[LRU_LIST].forEach(hit => { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) - this[LENGTH] += hit.length - }) + const UintArray = getUintArray(max) + if (!UintArray) { + throw new Error('invalid max value: ' + max) } - trim(this) - } - get lengthCalculator () { return this[LENGTH_CALCULATOR] } - get length () { return this[LENGTH] } - get itemCount () { return this[LRU_LIST].length } + this.max = max + this.maxSize = maxSize || 0 + 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('sizeCalculating set to non-function') + } + } + 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 - rforEach (fn, thisp) { - thisp = thisp || this - for (let walker = this[LRU_LIST].tail; walker !== null;) { - const prev = walker.prev - forEachStep(this, fn, walker, thisp) - walker = prev + if (this.maxSize) { + if (!isPosInt(this.maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified') + } + this.initializeSizeTracking() } - } - forEach (fn, thisp) { - thisp = thisp || this - for (let walker = this[LRU_LIST].head; walker !== null;) { - const next = walker.next - forEachStep(this, fn, walker, thisp) - walker = next + 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() } - } - keys () { - return this[LRU_LIST].toArray().map(k => k.key) + if (stale) { + deprecatedOption('stale', 'allowStale') + } + if (maxAge) { + deprecatedOption('maxAge', 'ttl') + } + if (length) { + deprecatedOption('length', 'sizeCalculation') + } } - values () { - return this[LRU_LIST].toArray().map(k => k.value) + 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.isStale = (index) => { + return this.ttls[index] !== 0 && this.starts[index] !== 0 && + ((cachedNow || getNow()) - this.starts[index] > this.ttls[index]) + } } - - reset () { - if (this[DISPOSE] && - this[LRU_LIST] && - this[LRU_LIST].length) { - this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) + 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.addItemSize = (index, v, k, size, sizeCalculation) => { + const s = size || (sizeCalculation ? sizeCalculation(v, k) : 0) + this.sizes[index] = isPosInt(s) ? s : 0 + 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) } - - this[CACHE] = new Map() // hash of items by key - this[LRU_LIST] = new Yallist() // list of items in order of use recency - this[LENGTH] = 0 // length of items in the list } - - dump () { - return this[LRU_LIST].map(hit => - isStale(this, hit) ? false : { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }).toArray().filter(h => h) + removeItemSize (index) {} + addItemSize (index, v, k, size, sizeCalculation) {} + + *indexes ({ allowStale = this.allowStale } = {}) { + if (this.size) { + for (let i = this.tail, j; true; ) { + if (!this.isValidIndex(i)) { + break + } + j = i === this.head + if (allowStale || !this.isStale(i)) { + yield i + } + if (i === this.head) { + break + } else { + i = this.prev[i] + } + } + } } - dumpLru () { - return this[LRU_LIST] + *rindexes ({ allowStale = this.allowStale } = {}) { + if (this.size) { + for (let i = this.head, j; true; ) { + if (!this.isValidIndex(i)) { + break + } + if (allowStale || !this.isStale(i)) { + yield i + } + // either the tail now, or WAS the tail, and deleted + if (i === this.tail) { + break + } else { + i = this.next[i] + } + } + } } - set (key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE] + isValidIndex (index) { + return this.keyMap.get(this.keyList[index]) === index + } - if (maxAge && typeof maxAge !== 'number') - throw new TypeError('maxAge must be a number') + *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]] + } + } - const now = maxAge ? Date.now() : 0 - const len = this[LENGTH_CALCULATOR](value, key) + *keys () { + for (const i of this.indexes()) { + yield this.keyList[i] + } + } + *rkeys () { + for (const i of this.rindexes()) { + yield this.keyList[i] + } + } - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)) - return false - } + *values () { + for (const i of this.indexes()) { + yield this.valList[i] + } + } + *rvalues () { + for (const i of this.rindexes()) { + yield this.valList[i] + } + } - const node = this[CACHE].get(key) - const item = node.value + [Symbol.iterator] () { + return this.entries() + } - // dispose of the old one before overwriting - // split out into 2 ifs for better coverage tracking - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) - this[DISPOSE](key, item.value) + 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) } + } + } - item.now = now - item.maxAge = maxAge - item.value = value - this[LENGTH] += len - item.length - item.length = len - this.get(key) - trim(this) - return true + forEach (fn, thisp = this) { + for (const i of this.indexes()) { + fn.call(thisp, this.valList[i], this.keyList[i], this) } + } - const hit = new Entry(key, value, len, now, maxAge) + rforEach (fn, thisp = this) { + for (const i of this.rindexes()) { + fn.call(thisp, this.valList[i], this.keyList[i], this) + } + } - // oversized objects fall out of cache automatically. - if (hit.length > this[MAX]) { - if (this[DISPOSE]) - this[DISPOSE](key, value) + get prune () { + deprecatedMethod('prune', 'purgeStale') + return this.purgeStale + } - return false + 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 + } - this[LENGTH] += hit.length - this[LRU_LIST].unshift(hit) - this[CACHE].set(key, this[LRU_LIST].head) - trim(this) - return true + 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 } - has (key) { - if (!this[CACHE].has(key)) return false - const hit = this[CACHE].get(key).value - return !isStale(this, hit) + load (arr) { + this.clear() + for (const [key, entry] of arr) { + this.set(key, entry.value, entry) + } } - get (key) { - return get(this, key, true) + dispose (v, k, reason) {} + + set (k, v, { + ttl = this.ttl, + noDisposeOnSet = this.noDisposeOnSet, + size = 0, + sizeCalculation = this.sizeCalculation, + noUpdateTTL = this.noUpdateTTL, + } = {}) { + 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, sizeCalculation) + noUpdateTTL = false + } else { + // update + const oldVal = this.valList[index] + if (v !== oldVal) { + 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, sizeCalculation) + } + 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 } - peek (key) { - return get(this, key, false) + 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 () { - const node = this[LRU_LIST].tail - if (!node) - return null + 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] + 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 + } - del(this, node) - return node.value + has (k) { + return this.keyMap.has(k) && !this.isStale(this.keyMap.get(k)) } - del (key) { - del(this, this[CACHE].get(key)) + // 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] + } } - load (arr) { - // reset the cache - this.reset() - - const now = Date.now() - // A previous serialized cache has the most recent items first - for (let l = arr.length - 1; l >= 0; l--) { - const hit = arr[l] - const expiresAt = hit.e || 0 - if (expiresAt === 0) - // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - else { - const maxAge = expiresAt - now - // dont add already expired items - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge) + get (k, { + allowStale = this.allowStale, + updateAgeOnGet = this.updateAgeOnGet, + } = {}) { + const index = this.keyMap.get(k) + if (index !== undefined) { + if (this.isStale(index)) { + const value = allowStale ? this.valList[index] : undefined + this.delete(k) + return value + } else { + this.moveToTail(index) + if (updateAgeOnGet) { + this.updateItemAge(index) } + return this.valList[index] } } } - prune () { - this[CACHE].forEach((value, key) => get(this, key, false)) + connect (p, n) { + this.prev[n] = p + this.next[p] = n } -} -const get = (self, key, doUse) => { - const node = self[CACHE].get(key) - if (node) { - const hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) - return undefined - } else { - if (doUse) { - if (self[UPDATE_AGE_ON_GET]) - node.value.now = Date.now() - self[LRU_LIST].unshiftNode(node) + 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 } - return hit.value } -} - -const isStale = (self, hit) => { - if (!hit || (!hit.maxAge && !self[MAX_AGE])) - return false - const diff = Date.now() - hit.now - return hit.maxAge ? diff > hit.maxAge - : self[MAX_AGE] && (diff > self[MAX_AGE]) -} - -const trim = self => { - if (self[LENGTH] > self[MAX]) { - for (let walker = self[LRU_LIST].tail; - self[LENGTH] > self[MAX] && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - const prev = walker.prev - del(self, walker) - walker = prev + 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) + this.dispose(this.valList[index], k, 'delete') + if (this.disposeAfter) { + this.disposed.push([this.valList[index], 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 } -} -const del = (self, node) => { - if (node) { - const hit = node.value - if (self[DISPOSE]) - self[DISPOSE](hit.key, hit.value) - - self[LENGTH] -= hit.length - self[CACHE].delete(hit.key) - self[LRU_LIST].removeNode(node) + clear () { + if (this.dispose !== LRUCache.prototype.dispose) { + for (const index of this.rindexes({ allowStale: true })) { + this.dispose(this.valList[index], this.keyList[index], 'delete') + } + } + if (this.disposeAfter) { + for (const index of this.rindexes({ allowStale: true })) { + this.disposed.push([this.valList[index], this.keyList[index], '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()) + } + } } -} - -class Entry { - constructor (key, value, length, now, maxAge) { - this.key = key - this.value = value - this.length = length - this.now = now - this.maxAge = maxAge || 0 + get reset () { + deprecatedMethod('reset', 'clear') + return this.clear } -} -const forEachStep = (self, fn, node, thisp) => { - let hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) - hit = undefined + get length () { + deprecatedProperty('length', 'size') + return this.size } - if (hit) - fn.call(thisp, hit.value, hit.key, self) } module.exports = LRUCache diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json index 43b7502c3e7c7..a62f74c2b648a 100644 --- a/node_modules/lru-cache/package.json +++ b/node_modules/lru-cache/package.json @@ -1,7 +1,7 @@ { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "version": "6.0.0", + "version": "7.5.1", "author": "Isaac Z. Schlueter ", "keywords": [ "mru", @@ -9,8 +9,10 @@ "cache" ], "scripts": { + "build": "", "test": "tap", "snap": "tap", + "size": "size-limit", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" @@ -18,17 +20,24 @@ "main": "index.js", "repository": "git://github.com/isaacs/node-lru-cache.git", "devDependencies": { + "@size-limit/preset-small-lib": "^7.0.8", "benchmark": "^2.1.4", - "tap": "^14.10.7" + "size-limit": "^7.0.8", + "tap": "^15.1.6" }, "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, "files": [ "index.js" ], "engines": { - "node": ">=10" - } + "node": ">=12" + }, + "tap": { + "coverage-map": "map.js" + }, + "size-limit": [ + { + "path": "./index.js" + } + ] } diff --git a/node_modules/make-fetch-happen/node_modules/lru-cache/LICENSE b/node_modules/make-fetch-happen/node_modules/lru-cache/LICENSE deleted file mode 100644 index 9b58a3e03d1df..0000000000000 --- a/node_modules/make-fetch-happen/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/make-fetch-happen/node_modules/lru-cache/bundle/main.js b/node_modules/make-fetch-happen/node_modules/lru-cache/bundle/main.js deleted file mode 100644 index b9c8be2ffa2e4..0000000000000 --- a/node_modules/make-fetch-happen/node_modules/lru-cache/bundle/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var t={10:t=>{const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=new Set,e=(t,i)=>{const s=`LRU_CACHE_OPTION_${t}`;l(s)&&o(s,`${t} option`,`options.${i}`,d)},h=(t,i)=>{const s=`LRU_CACHE_METHOD_${t}`;if(l(s)){const{prototype:e}=d,{get:h}=Object.getOwnPropertyDescriptor(e,t);o(s,`${t} method`,`cache.${i}()`,h)}},l=t=>"object"==typeof process&&process&&!(process.noDeprecation||s.has(t)),o=(t,i,e,h)=>{s.add(t),process.emitWarning(`The ${i} is deprecated. Please use ${e} instead.`,"DeprecationWarning",t,h)},a=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),n=t=>a(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?r:null:null;class r extends Array{constructor(t){super(t),this.fill(0)}}class p{constructor(t){const i=n(t);this.heap=new i(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class d{constructor(t={}){const{max:i,ttl:s,ttlResolution:h=1,ttlAutopurge:l,updateAgeOnGet:o,allowStale:r,dispose:c,disposeAfter:f,noDisposeOnSet:u,noUpdateTTL:z,maxSize:v,sizeCalculation:y}=t,{length:S,maxAge:g,stale:m}=t instanceof d?{}:t;if(!a(i))throw new TypeError("max option must be an integer");const x=n(i);if(!x)throw new Error("invalid max value: "+i);if(this.max=i,this.maxSize=v||0,this.sizeCalculation=y||S,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculating set to non-function")}if(this.keyMap=new Map,this.keyList=new Array(i).fill(null),this.valList=new Array(i).fill(null),this.next=new x(i),this.prev=new x(i),this.head=0,this.tail=0,this.free=new p(i),this.initialFill=1,this.size=0,"function"==typeof c&&(this.dispose=c),"function"==typeof f?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!z,this.maxSize){if(!a(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!r||!!m,this.updateAgeOnGet=!!o,this.ttlResolution=a(h)||0===h?h:1,this.ttlAutopurge=!!l,this.ttl=s||g||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}m&&e("stale","allowStale"),g&&e("maxAge","ttl"),S&&e("length","sizeCalculation")}initializeTTLTracking(){this.ttls=new r(this.max),this.starts=new r(this.max),this.setItemTTL=(t,s)=>{if(this.starts[t]=0!==s?i.now():0,this.ttls[t]=s,0!==s&&this.ttlAutopurge){const i=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),s+1);i.unref&&i.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const s=()=>{const s=i.now();if(this.ttlResolution>0){t=s;const i=setTimeout((()=>t=0),this.ttlResolution);i.unref&&i.unref()}return s};this.isStale=i=>0!==this.ttls[i]&&0!==this.starts[i]&&(t||s())-this.starts[i]>this.ttls[i]}updateItemAge(t){}setItemTTL(t,i){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new r(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.addItemSize=(t,i,s,e,h)=>{const l=e||(h?h(i,s):0);this.sizes[t]=a(l)?l:0;const o=this.maxSize-this.sizes[t];for(;this.calculatedSize>o;)this.evict();this.calculatedSize+=this.sizes[t]},this.delete=t=>{if(0!==this.size){const i=this.keyMap.get(t);void 0!==i&&(this.calculatedSize-=this.sizes[i])}return d.prototype.delete.call(this,t)}}removeItemSize(t){}addItemSize(t,i,s,e,h){}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let i=this.tail;!t&&this.isStale(i)||(yield i),i!==this.head;i=this.prev[i]);}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let i=this.head;!t&&this.isStale(i)||(yield i),i!==this.tail;i=this.next[i]);}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,i={}){for(const s of this.indexes())if(t(this.valList[s],this.keyList[s],this))return this.get(this.keyList[s],i)}forEach(t,i=this){for(const s of this.indexes())t.call(i,this.valList[s],this.keyList[s],this)}rforEach(t,i=this){for(const s of this.rindexes())t.call(i,this.valList[s],this.keyList[s],this)}get prune(){return h("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const i of this.rindexes({allowStale:!0}))this.isStale(i)&&(this.delete(this.keyList[i]),t=!0);return t}dump(){const t=[];for(const i of this.indexes()){const s=this.keyList[i],e={value:this.valList[i]};this.ttls&&(e.ttl=this.ttls[i]),this.sizes&&(e.size=this.sizes[i]),t.unshift([s,e])}return t}load(t){this.clear();for(const[i,s]of t)this.set(i,s.value,s)}dispose(t,i,s){}set(t,i,{ttl:s=this.ttl,noDisposeOnSet:e=this.noDisposeOnSet,size:h=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:o=this.noUpdateTTL}={}){let a=0===this.size?void 0:this.keyMap.get(t);if(void 0===a)a=this.newIndex(),this.keyList[a]=t,this.valList[a]=i,this.keyMap.set(t,a),this.next[this.tail]=a,this.prev[a]=this.tail,this.tail=a,this.size++,this.addItemSize(a,i,t,h,l),o=!1;else{const s=this.valList[a];i!==s&&(e||(this.dispose(s,t,"set"),this.disposeAfter&&this.disposed.push([s,t,"set"])),this.removeItemSize(a),this.valList[a]=i,this.addItemSize(a,i,t,h,l)),this.moveToTail(a)}if(0===s||0!==this.ttl||this.ttls||this.initializeTTLTracking(),o||this.setItemTTL(a,s),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max?this.evict():0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(),t}}evict(){const t=this.head,i=this.keyList[t],s=this.valList[t];return this.dispose(s,i,"evict"),this.disposeAfter&&this.disposed.push([s,i,"evict"]),this.removeItemSize(t),this.head=this.next[t],this.keyMap.delete(i),this.size--,t}has(t){return this.keyMap.has(t)&&!this.isStale(this.keyMap.get(t))}peek(t,{allowStale:i=this.allowStale}={}){const s=this.keyMap.get(t);if(void 0!==s&&(i||!this.isStale(s)))return this.valList[s]}get(t,{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet}={}){const e=this.keyMap.get(t);if(void 0!==e){if(this.isStale(e)){const s=i?this.valList[e]:void 0;return this.delete(t),s}return this.moveToTail(e),s&&this.updateItemAge(e),this.valList[e]}}connect(t,i){this.prev[i]=t,this.next[t]=i}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return h("del","delete"),this.delete}delete(t){let i=!1;if(0!==this.size){const s=this.keyMap.get(t);void 0!==s&&(i=!0,1===this.size?this.clear():(this.removeItemSize(s),this.dispose(this.valList[s],t,"delete"),this.disposeAfter&&this.disposed.push([this.valList[s],t,"delete"]),this.keyMap.delete(t),this.keyList[s]=null,this.valList[s]=null,s===this.tail?this.tail=this.prev[s]:s===this.head?this.head=this.next[s]:(this.next[this.prev[s]]=this.next[s],this.prev[this.next[s]]=this.prev[s]),this.size--,this.free.push(s)))}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return i}clear(){if(this.dispose!==d.prototype.dispose)for(const t of this.rindexes({allowStale:!0}))this.dispose(this.valList[t],this.keyList[t],"delete");if(this.disposeAfter)for(const t of this.rindexes({allowStale:!0}))this.disposed.push([this.valList[t],this.keyList[t],"delete"]);if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),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,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return h("reset","clear"),this.clear}get length(){return((t,i)=>{const s="LRU_CACHE_PROPERTY_length";if(l(s)){const{prototype:i}=d,{get:e}=Object.getOwnPropertyDescriptor(i,t);o(s,"length property","cache.size",e)}})("length"),this.size}}t.exports=d}},i={},s=function s(e){var h=i[e];if(void 0!==h)return h.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,s),l.exports}(10);module.exports=s})(); \ No newline at end of file diff --git a/node_modules/make-fetch-happen/node_modules/lru-cache/bundle/main.mjs b/node_modules/make-fetch-happen/node_modules/lru-cache/bundle/main.mjs deleted file mode 100644 index 3a4d674c07a41..0000000000000 --- a/node_modules/make-fetch-happen/node_modules/lru-cache/bundle/main.mjs +++ /dev/null @@ -1 +0,0 @@ -var t={10:t=>{const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=new Set,e=(t,i)=>{const s=`LRU_CACHE_OPTION_${t}`;l(s)&&o(s,`${t} option`,`options.${i}`,d)},h=(t,i)=>{const s=`LRU_CACHE_METHOD_${t}`;if(l(s)){const{prototype:e}=d,{get:h}=Object.getOwnPropertyDescriptor(e,t);o(s,`${t} method`,`cache.${i}()`,h)}},l=t=>!(process.noDeprecation||s.has(t)),o=(t,i,e,h)=>{s.add(t),process.emitWarning(`The ${i} is deprecated. Please use ${e} instead.`,"DeprecationWarning",t,h)},n=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),a=t=>n(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?r:null:null;class r extends Array{constructor(t){super(t),this.fill(0)}}class p{constructor(t){const i=a(t);this.heap=new i(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class d{constructor(t={}){const{max:i,ttl:s,ttlResolution:h=1,ttlAutopurge:l,updateAgeOnGet:o,allowStale:r,dispose:c,disposeAfter:f,noDisposeOnSet:u,noUpdateTTL:z,maxSize:v,sizeCalculation:y}=t,{length:g,maxAge:m,stale:S}=t instanceof d?{}:t;if(!n(i))throw new TypeError("max option must be an integer");const L=a(i);if(!L)throw new Error("invalid max value: "+i);if(this.max=i,this.maxSize=v||0,this.sizeCalculation=y||g,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculating set to non-function")}if(this.keyMap=new Map,this.keyList=new Array(i).fill(null),this.valList=new Array(i).fill(null),this.next=new L(i),this.prev=new L(i),this.head=0,this.tail=0,this.free=new p(i),this.initialFill=1,this.size=0,"function"==typeof c&&(this.dispose=c),"function"==typeof f?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!z,this.maxSize){if(!n(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!r||!!S,this.updateAgeOnGet=!!o,this.ttlResolution=n(h)||0===h?h:1,this.ttlAutopurge=!!l,this.ttl=s||m||0,this.ttl){if(!n(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}S&&e("stale","allowStale"),m&&e("maxAge","ttl"),g&&e("length","sizeCalculation")}initializeTTLTracking(){this.ttls=new r(this.max),this.starts=new r(this.max),this.setItemTTL=(t,s)=>{if(this.starts[t]=0!==s?i.now():0,this.ttls[t]=s,0!==s&&this.ttlAutopurge){const i=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),s+1);i.unref&&i.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const s=()=>{const s=i.now();if(this.ttlResolution>0){t=s;const i=setTimeout((()=>t=0),this.ttlResolution);i.unref&&i.unref()}return s};this.isStale=i=>0!==this.ttls[i]&&0!==this.starts[i]&&(t||s())-this.starts[i]>this.ttls[i]}updateItemAge(t){}setItemTTL(t,i){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new r(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.addItemSize=(t,i,s,e,h)=>{const l=e||(h?h(i,s):0);this.sizes[t]=n(l)?l:0;const o=this.maxSize-this.sizes[t];for(;this.calculatedSize>o;)this.evict();this.calculatedSize+=this.sizes[t]},this.delete=t=>{if(0!==this.size){const i=this.keyMap.get(t);void 0!==i&&(this.calculatedSize-=this.sizes[i])}return d.prototype.delete.call(this,t)}}removeItemSize(t){}addItemSize(t,i,s,e,h){}*indexes(){if(this.size)for(let t=this.tail;this.isStale(t)||(yield t),t!==this.head;t=this.prev[t]);}*rindexes(){if(this.size)for(let t=this.head;this.isStale(t)||(yield t),t!==this.tail;t=this.next[t]);}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,i={}){for(const s of this.indexes())if(t(this.valList[s],this.keyList[s],this))return this.get(this.keyList[s],i)}forEach(t,i=this){for(const s of this.indexes())t.call(i,this.valList[s],this.keyList[s],this)}rforEach(t,i=this){for(const s of this.rindexes())t.call(i,this.valList[s],this.keyList[s],this)}get prune(){return h("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;if(this.size)for(let i=this.head;;i=this.next[i]){const s=i===this.tail;if(this.isStale(i)&&(this.delete(this.keyList[i]),t=!0),s)break}return t}dump(){const t=[];for(const i of this.indexes()){const s=this.keyList[i],e={value:this.valList[i]};this.ttls&&(e.ttl=this.ttls[i]),this.sizes&&(e.size=this.sizes[i]),t.unshift([s,e])}return t}load(t){this.clear();for(const[i,s]of t)this.set(i,s.value,s)}dispose(t,i,s){}set(t,i,{ttl:s=this.ttl,noDisposeOnSet:e=this.noDisposeOnSet,size:h=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:o=this.noUpdateTTL}={}){let n=0===this.size?void 0:this.keyMap.get(t);if(void 0===n)n=this.newIndex(),this.keyList[n]=t,this.valList[n]=i,this.keyMap.set(t,n),this.next[this.tail]=n,this.prev[n]=this.tail,this.tail=n,this.size++,this.addItemSize(n,i,t,h,l),o=!1;else{const s=this.valList[n];i!==s&&(e||(this.dispose(s,t,"set"),this.disposeAfter&&this.disposed.push([s,t,"set"])),this.removeItemSize(n),this.valList[n]=i,this.addItemSize(n,i,t,h,l)),this.moveToTail(n)}if(0===s||0!==this.ttl||this.ttls||this.initializeTTLTracking(),o||this.setItemTTL(n,s),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max?this.evict():0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(),t}}evict(){const t=this.head,i=this.keyList[t],s=this.valList[t];return this.dispose(s,i,"evict"),this.disposeAfter&&this.disposed.push([s,i,"evict"]),this.removeItemSize(t),this.head=this.next[t],this.keyMap.delete(i),this.size--,t}has(t){return this.keyMap.has(t)&&!this.isStale(this.keyMap.get(t))}peek(t,{allowStale:i=this.allowStale}={}){const s=this.keyMap.get(t);if(void 0!==s&&(i||!this.isStale(s)))return this.valList[s]}get(t,{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet}={}){const e=this.keyMap.get(t);if(void 0!==e){if(this.isStale(e)){const s=i?this.valList[e]:void 0;return this.delete(t),s}return this.moveToTail(e),s&&this.updateItemAge(e),this.valList[e]}}connect(t,i){this.prev[i]=t,this.next[t]=i}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return h("del","delete"),this.delete}delete(t){let i=!1;if(0!==this.size){const s=this.keyMap.get(t);void 0!==s&&(i=!0,1===this.size?this.clear():(this.removeItemSize(s),this.dispose(this.valList[s],t,"delete"),this.disposeAfter&&this.disposed.push([this.valList[s],t,"delete"]),this.keyMap.delete(t),this.keyList[s]=null,this.valList[s]=null,s===this.tail?this.tail=this.prev[s]:s===this.head?this.head=this.next[s]:(this.next[this.prev[s]]=this.next[s],this.prev[this.next[s]]=this.prev[s]),this.size--,this.free.push(s)))}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return i}clear(){if(this.dispose!==d.prototype.dispose)for(const t of this.rindexes())this.dispose(this.valList[t],this.keyList[t],"delete");if(this.disposeAfter)for(const t of this.rindexes())this.disposed.push([this.valList[t],this.keyList[t],"delete"]);if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),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,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return h("reset","clear"),this.clear}get length(){return((t,i)=>{const s="LRU_CACHE_PROPERTY_length";if(l(s)){const{prototype:i}=d,{get:e}=Object.getOwnPropertyDescriptor(i,t);o(s,"length property","cache.size",e)}})("length"),this.size}}t.exports=d}},i={};!function s(e){var h=i[e];if(void 0!==h)return h.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,s),l.exports}(10); \ No newline at end of file diff --git a/node_modules/make-fetch-happen/node_modules/lru-cache/index.js b/node_modules/make-fetch-happen/node_modules/lru-cache/index.js deleted file mode 100644 index 77adaa6451a0c..0000000000000 --- a/node_modules/make-fetch-happen/node_modules/lru-cache/index.js +++ /dev/null @@ -1,583 +0,0 @@ -const perf = typeof performance === 'object' && performance && - typeof performance.now === 'function' ? performance : Date - -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 && - !(process.noDeprecation || warned.has(code)) -const warn = (code, what, instead, fn) => { - warned.add(code) - process.emitWarning(`The ${what} is deprecated. Please use ${instead} instead.`, '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 = getUintArray(max) - 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, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize, - sizeCalculation, - } = 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 (!isPosInt(max)) { - throw new TypeError('max option must be an integer') - } - - const UintArray = getUintArray(max) - if (!UintArray) { - throw new Error('invalid max value: ' + max) - } - - this.max = max - this.maxSize = maxSize || 0 - 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('sizeCalculating set to non-function') - } - } - 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) { - 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() - } - - if (stale) { - deprecatedOption('stale', 'allowStale') - } - if (maxAge) { - deprecatedOption('maxAge', 'ttl') - } - if (length) { - deprecatedOption('length', 'sizeCalculation') - } - } - - 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.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.addItemSize = (index, v, k, size, sizeCalculation) => { - const s = size || (sizeCalculation ? sizeCalculation(v, k) : 0) - this.sizes[index] = isPosInt(s) ? s : 0 - 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, sizeCalculation) {} - - *indexes ({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.tail; true; i = this.prev[i]) { - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.head) { - break - } - } - } - } - *rindexes ({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.head; true; i = this.next[i]) { - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.tail) { - break - } - } - } - } - - *entries () { - for (const i of this.indexes()) { - yield [this.keyList[i], this.valList[i]] - } - } - - *keys () { - for (const i of this.indexes()) { - yield this.keyList[i] - } - } - - *values () { - for (const i of this.indexes()) { - 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, - } = {}) { - 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, sizeCalculation) - noUpdateTTL = false - } else { - // update - const oldVal = this.valList[index] - if (v !== oldVal) { - 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, sizeCalculation) - } - 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] - 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] - } - } - - get (k, { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined) { - if (this.isStale(index)) { - const value = allowStale ? this.valList[index] : undefined - this.delete(k) - return value - } else { - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return this.valList[index] - } - } - } - - 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) - this.dispose(this.valList[index], k, 'delete') - if (this.disposeAfter) { - this.disposed.push([this.valList[index], 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 () { - if (this.dispose !== LRUCache.prototype.dispose) { - for (const index of this.rindexes({ allowStale: true })) { - this.dispose(this.valList[index], this.keyList[index], 'delete') - } - } - if (this.disposeAfter) { - for (const index of this.rindexes({ allowStale: true })) { - this.disposed.push([this.valList[index], this.keyList[index], '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 diff --git a/node_modules/make-fetch-happen/node_modules/lru-cache/package.json b/node_modules/make-fetch-happen/node_modules/lru-cache/package.json deleted file mode 100644 index 313bfcbbfd206..0000000000000 --- a/node_modules/make-fetch-happen/node_modules/lru-cache/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "7.4.2", - "author": "Isaac Z. Schlueter ", - "keywords": [ - "mru", - "lru", - "cache" - ], - "scripts": { - "prepare": "webpack-cli -o bundle ./index.js --node-env production", - "build": "npm run prepare", - "presize": "npm run prepare", - "test": "tap", - "snap": "tap", - "size": "size-limit", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" - }, - "main": "index.js", - "browser": "./bundle/main.js", - "exports": { - ".": "./index.js", - "./browser": "./bundle/main.js" - }, - "repository": "git://github.com/isaacs/node-lru-cache.git", - "devDependencies": { - "@size-limit/preset-small-lib": "^7.0.8", - "benchmark": "^2.1.4", - "size-limit": "^7.0.8", - "tap": "^15.1.6", - "webpack-cli": "^4.9.2" - }, - "license": "ISC", - "files": [ - "index.js", - "bundle" - ], - "engines": { - "node": ">=12" - }, - "tap": { - "coverage-map": "map.js" - }, - "size-limit": [ - { - "path": "./bundle/main.js" - } - ] -} diff --git a/node_modules/make-fetch-happen/package.json b/node_modules/make-fetch-happen/package.json index c8c5842b33a9f..e52131b8a8e01 100644 --- a/node_modules/make-fetch-happen/package.json +++ b/node_modules/make-fetch-happen/package.json @@ -1,6 +1,6 @@ { "name": "make-fetch-happen", - "version": "10.0.5", + "version": "10.0.6", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ @@ -34,15 +34,15 @@ "license": "ISC", "dependencies": { "agentkeepalive": "^4.2.1", - "cacache": "^15.3.0", + "cacache": "^16.0.0", "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", - "lru-cache": "^7.4.1", + "lru-cache": "^7.5.1", "minipass": "^3.1.6", "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.2", + "minipass-fetch": "^2.0.3", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", @@ -52,7 +52,7 @@ }, "devDependencies": { "@npmcli/template-oss": "^2.9.2", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "mkdirp": "^1.0.4", "nock": "^13.2.4", "rimraf": "^3.0.2", diff --git a/node_modules/minipass-fetch/lib/index.js b/node_modules/minipass-fetch/lib/index.js index 473630e1a5857..22257a417aff8 100644 --- a/node_modules/minipass-fetch/lib/index.js +++ b/node_modules/minipass-fetch/lib/index.js @@ -204,6 +204,14 @@ const fetch = async (url, opts) => { timeout: request.timeout, } + // if the redirect is to a new hostname, strip the authorization and cookie headers + const parsedOriginal = new URL(request.url) + const parsedRedirect = new URL(locationURL) + if (parsedOriginal.hostname !== parsedRedirect.hostname) { + requestOpts.headers.delete('authorization') + requestOpts.headers.delete('cookie') + } + // HTTP-redirect fetch step 11 if (res.statusCode === 303 || ( (res.statusCode === 301 || res.statusCode === 302) && diff --git a/node_modules/minipass-fetch/package.json b/node_modules/minipass-fetch/package.json index 47e32dad6df8b..68e1ce134cd26 100644 --- a/node_modules/minipass-fetch/package.json +++ b/node_modules/minipass-fetch/package.json @@ -1,6 +1,6 @@ { "name": "minipass-fetch", - "version": "2.0.2", + "version": "2.0.3", "description": "An implementation of window.fetch in Node.js using Minipass streams", "license": "MIT", "main": "lib/index.js", @@ -22,11 +22,12 @@ "check-coverage": true }, "devDependencies": { - "@npmcli/template-oss": "^2.8.1", + "@npmcli/template-oss": "^2.9.2", "@ungap/url-search-params": "^0.2.2", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "~1.7.3", "form-data": "^4.0.0", + "nock": "^13.2.4", "parted": "^0.1.1", "string-to-arraybuffer": "^1.0.2", "tap": "^15.1.6" @@ -58,6 +59,6 @@ }, "author": "GitHub Inc.", "templateOSS": { - "version": "2.8.1" + "version": "2.9.2" } } diff --git a/node_modules/normalize-package-data/AUTHORS b/node_modules/normalize-package-data/AUTHORS deleted file mode 100644 index 66282ba1d1197..0000000000000 --- a/node_modules/normalize-package-data/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -# Names sorted by how much code was originally theirs. -Isaac Z. Schlueter -Meryn Stol -Robert Kowalski diff --git a/node_modules/normalize-package-data/lib/fixer.js b/node_modules/normalize-package-data/lib/fixer.js index 97c26b26b461d..0846f2c045a6e 100644 --- a/node_modules/normalize-package-data/lib/fixer.js +++ b/node_modules/normalize-package-data/lib/fixer.js @@ -8,6 +8,8 @@ var extractDescription = require('./extract_description') var url = require('url') var typos = require('./typos.json') +var isEmail = str => str.includes('@') && (str.indexOf('@') < str.lastIndexOf('.')) + module.exports = { // default warning function warn: function () {}, @@ -127,7 +129,7 @@ module.exports = { if (!data.dependencies) { data.dependencies = {} } - if (Object.prototype.hasOwnProperty.call(data.dependencies, bd)) { + if (!Object.prototype.hasOwnProperty.call(data.dependencies, bd)) { this.warn('nonDependencyBundleDependency', bd) data.dependencies[bd] = '*' } @@ -213,7 +215,7 @@ module.exports = { fixNameField: function (data, options) { if (typeof options === 'boolean') { - options = {strict: options} + options = { strict: options } } else if (typeof options === 'undefined') { options = {} } @@ -261,16 +263,15 @@ module.exports = { if (!data.bugs && data.repository && data.repository.url) { var hosted = hostedGitInfo.fromUrl(data.repository.url) if (hosted && hosted.bugs()) { - data.bugs = {url: hosted.bugs()} + data.bugs = { url: hosted.bugs() } } } else if (data.bugs) { - var emailRe = /^.+@.*\..+$/ if (typeof data.bugs === 'string') { - if (emailRe.test(data.bugs)) { - data.bugs = {email: data.bugs} + if (isEmail(data.bugs)) { + data.bugs = { email: data.bugs } /* eslint-disable-next-line node/no-deprecated-api */ } else if (url.parse(data.bugs).protocol) { - data.bugs = {url: data.bugs} + data.bugs = { url: data.bugs } } else { this.warn('nonEmailUrlBugsString') } @@ -287,7 +288,7 @@ module.exports = { } } if (oldBugs.email) { - if (typeof (oldBugs.email) === 'string' && emailRe.test(oldBugs.email)) { + if (typeof (oldBugs.email) === 'string' && isEmail(oldBugs.email)) { data.bugs.email = oldBugs.email } else { this.warn('nonEmailBugsEmailField') @@ -399,8 +400,8 @@ function parsePerson (person) { return person } var name = person.match(/^([^(<]+)/) - var url = person.match(/\(([^)]+)\)/) - var email = person.match(/<([^>]+)>/) + var url = person.match(/\(([^()]+)\)/) + var email = person.match(/<([^<>]+)>/) var obj = {} if (name && name[0].trim()) { obj.name = name[0].trim() diff --git a/node_modules/normalize-package-data/package.json b/node_modules/normalize-package-data/package.json index 17f167ea13f51..a6f1244eb5a25 100644 --- a/node_modules/normalize-package-data/package.json +++ b/node_modules/normalize-package-data/package.json @@ -1,7 +1,7 @@ { "name": "normalize-package-data", - "version": "3.0.3", - "author": "Meryn Stol ", + "version": "4.0.0", + "author": "GitHub Inc.", "description": "Normalizes data that can be found in package.json files.", "license": "BSD-2-Clause", "repository": { @@ -13,29 +13,40 @@ "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "preversion": "npm test", - "test": "tap test/*.js --branches 85 --functions 90 --lines 85 --statements 85", + "test": "tap", "npmclilint": "npmcli-lint", - "lint": "npm run npmclilint -- \"lib/**/*.*js\" \"test/**/*.*js\"", + "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint --", - "postsnap": "npm run lintfix --" + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "npm-template-check", + "template-copy": "npm-template-copy --force", + "snap": "tap" }, "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "devDependencies": { - "@npmcli/lint": "^1.0.2", + "@npmcli/template-oss": "^2.9.2", "tap": "^15.0.9" }, "files": [ - "lib/*.js", - "lib/*.json", - "AUTHORS" + "bin", + "lib" ], "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "templateOSS": { + "version": "2.9.2" + }, + "tap": { + "branches": 86, + "functions": 92, + "lines": 86, + "statements": 86 } } diff --git a/node_modules/npm-package-arg/package.json b/node_modules/npm-package-arg/package.json index b0821312a7f0d..25356af373982 100644 --- a/node_modules/npm-package-arg/package.json +++ b/node_modules/npm-package-arg/package.json @@ -1,6 +1,6 @@ { "name": "npm-package-arg", - "version": "9.0.0", + "version": "9.0.1", "description": "Parse the things that can be arguments to `npm install`", "main": "./lib/npa.js", "directories": { @@ -11,12 +11,12 @@ "lib" ], "dependencies": { - "hosted-git-info": "^4.1.0", + "hosted-git-info": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^3.0.0" }, "devDependencies": { - "@npmcli/template-oss": "^2.7.1", + "@npmcli/template-oss": "^2.9.2", "tap": "^15.1.6" }, "scripts": { @@ -50,6 +50,6 @@ "branches": 97 }, "templateOSS": { - "version": "2.7.1" + "version": "2.9.2" } } diff --git a/node_modules/npm-packlist/bin/index.js b/node_modules/npm-packlist/bin/index.js index 40811db7d32e7..a42f5b74ce80e 100755 --- a/node_modules/npm-packlist/bin/index.js +++ b/node_modules/npm-packlist/bin/index.js @@ -6,18 +6,19 @@ process.argv.slice(2).forEach(arg => { if (arg === '-h' || arg === '--help') { console.log('usage: npm-packlist [-s --sort] [directory, directory, ...]') process.exit(0) - } else if (arg === '-s' || arg === '--sort') + } else if (arg === '-s' || arg === '--sort') { doSort = true - else + } else { dirs.push(arg) + } }) const sort = list => doSort ? list.sort((a, b) => a.localeCompare(b, 'en')) : list const packlist = require('../') -if (!dirs.length) +if (!dirs.length) { console.log(sort(packlist.sync({ path: process.cwd() })).join('\n')) -else { +} else { dirs.forEach(path => { console.log(`> ${path}`) console.log(sort(packlist.sync({ path })).join('\n')) diff --git a/node_modules/npm-packlist/index.js b/node_modules/npm-packlist/lib/index.js similarity index 99% rename from node_modules/npm-packlist/index.js rename to node_modules/npm-packlist/lib/index.js index 76018557cb9c8..1b67e4e71e04d 100644 --- a/node_modules/npm-packlist/index.js +++ b/node_modules/npm-packlist/lib/index.js @@ -58,6 +58,7 @@ const defaultRules = [ '*.orig', '/package-lock.json', '/yarn.lock', + '/pnpm-lock.yaml', '/archived-packages/**', ] @@ -248,7 +249,7 @@ const npmWalker = Class => class Walker extends Class { } } const processResults = results => { - for (const {negate, fileList} of results) { + for (const { negate, fileList } of results) { if (negate) { fileList.forEach(f => { f = f.replace(/\/+$/, '') @@ -276,7 +277,7 @@ const npmWalker = Class => class Walker extends Class { // maintain the index so that we process them in-order only once all // are completed, otherwise the parallelism messes things up, since a // glob like **/*.js will always be slower than a subsequent !foo.js - patterns.forEach(({pattern, negate}, i) => + patterns.forEach(({ pattern, negate }, i) => this.globFiles(pattern, (er, res) => then(pattern, negate, er, res, i))) } diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index 2fe493a203601..ab270f60713b6 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,40 +1,42 @@ { "name": "npm-packlist", - "version": "3.0.0", + "version": "4.0.0", "description": "Get a list of the files to add from a folder into an npm package", "directories": { "test": "test" }, - "main": "index.js", + "main": "lib", "dependencies": { - "glob": "^7.1.6", + "glob": "^7.2.0", "ignore-walk": "^4.0.1", - "npm-bundled": "^1.1.1", + "npm-bundled": "^1.1.2", "npm-normalize-package-bin": "^1.0.1" }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "author": "GitHub Inc.", "license": "ISC", "files": [ - "bin/index.js", - "index.js" + "bin", + "lib" ], "devDependencies": { - "@npmcli/lint": "^1.0.2", + "@npmcli/template-oss": "^2.9.2", "mutate-fs": "^2.1.1", - "tap": "^15.0.6" + "tap": "^15.1.6" }, "scripts": { "test": "tap", - "posttest": "npm run lint --", + "posttest": "npm run lint", "snap": "tap", "postsnap": "npm run lintfix --", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "eslint": "eslint", - "lint": "npm run npmclilint -- \"*.*js\" \"test/**/*.*js\"", + "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", - "npmclilint": "npmcli-lint" + "npmclilint": "npmcli-lint", + "postlint": "npm-template-check", + "template-copy": "npm-template-copy --force" }, "repository": { "type": "git", @@ -54,6 +56,9 @@ "npm-packlist": "bin/index.js" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "templateOSS": { + "version": "2.9.2" } } diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index fc6ab52fa9bc0..f49c23147a80c 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "13.0.3", + "version": "13.0.5", "description": "JavaScript package downloader", "author": "GitHub Inc.", "bin": { @@ -25,7 +25,7 @@ "coverage-map": "map.js" }, "devDependencies": { - "@npmcli/template-oss": "^2.7.1", + "@npmcli/template-oss": "^2.9.2", "mutate-fs": "^2.1.1", "npm-registry-mock": "^1.3.1", "tap": "^15.1.6" @@ -43,20 +43,20 @@ "@npmcli/git": "^3.0.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/promise-spawn": "^1.2.0", - "@npmcli/run-script": "^3.0.0", - "cacache": "^15.3.0", + "@npmcli/run-script": "^3.0.1", + "cacache": "^16.0.0", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", "infer-owner": "^1.0.4", "minipass": "^3.1.6", "mkdirp": "^1.0.4", "npm-package-arg": "^9.0.0", - "npm-packlist": "^3.0.0", + "npm-packlist": "^4.0.0", "npm-pick-manifest": "^7.0.0", - "npm-registry-fetch": "^13.0.0", + "npm-registry-fetch": "^13.0.1", "proc-log": "^2.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^4.1.1", + "read-package-json": "^5.0.0", "read-package-json-fast": "^2.0.3", "rimraf": "^3.0.2", "ssri": "^8.0.1", @@ -67,7 +67,7 @@ }, "repository": "git@github.com:npm/pacote", "templateOSS": { - "version": "2.7.1", + "version": "2.9.2", "windowsCI": false } } diff --git a/node_modules/read-package-json/read-json.js b/node_modules/read-package-json/lib/read-json.js similarity index 98% rename from node_modules/read-package-json/read-json.js rename to node_modules/read-package-json/lib/read-json.js index cb2b495521570..d0ee9af1ae750 100644 --- a/node_modules/read-package-json/read-json.js +++ b/node_modules/read-package-json/lib/read-json.js @@ -350,7 +350,9 @@ function mans (file, data, cb) { if (er) { return cb(er) } - data.man = mans.map(man => path.relative(dirname, path.join(cwd, man))) + data.man = mans.map(man => + path.relative(dirname, path.join(cwd, man)).split(path.sep).join('/') + ) return cb(null, data) }) } @@ -556,7 +558,7 @@ function fillTypes (file, data, cb) { var dtsPath = path.join(path.dirname(file), dts) var hasDTSFields = 'types' in data || 'typings' in data if (!hasDTSFields && fs.existsSync(dtsPath)) { - data.types = dts + data.types = dts.split(path.sep).join('/') } cb(null, data) diff --git a/node_modules/read-package-json/package.json b/node_modules/read-package-json/package.json index c86cf45f36d55..038047c970941 100644 --- a/node_modules/read-package-json/package.json +++ b/node_modules/read-package-json/package.json @@ -1,46 +1,55 @@ { "name": "read-package-json", - "version": "4.1.2", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "version": "5.0.0", + "author": "GitHub Inc.", "description": "The thing npm uses to read package.json files with semantics and defaults and validation", "repository": { "type": "git", "url": "https://github.com/npm/read-package-json.git" }, - "main": "read-json.js", + "main": "lib/read-json.js", "scripts": { "prerelease": "npm t", "postrelease": "npm publish && git push --follow-tags", "release": "standard-version -s", - "test": "tap --nyc-arg=--all --coverage test/*.js", + "test": "tap", "npmclilint": "npmcli-lint", - "lint": "npm run npmclilint -- --ignore-pattern test/fixtures \"*.*js\" \"test/**/*.*js\"", + "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint --", - "postsnap": "npm run lintfix --" + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "npm-template-check", + "template-copy": "npm-template-copy --force", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap" }, "dependencies": { - "glob": "^7.1.1", - "json-parse-even-better-errors": "^2.3.0", - "normalize-package-data": "^3.0.0", - "npm-normalize-package-bin": "^1.0.0" + "glob": "^7.2.0", + "json-parse-even-better-errors": "^2.3.1", + "normalize-package-data": "^4.0.0", + "npm-normalize-package-bin": "^1.0.1" }, "devDependencies": { - "@npmcli/lint": "^1.0.2", - "standard-version": "^9.3.1", + "@npmcli/template-oss": "^2.9.2", "tap": "^15.0.9" }, "license": "ISC", "files": [ - "read-json.js" + "bin", + "lib" ], "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" }, "tap": { "branches": 68, "functions": 83, "lines": 76, "statements": 77 + }, + "templateOSS": { + "version": "2.9.2" } } diff --git a/node_modules/@npmcli/git/node_modules/lru-cache/LICENSE b/node_modules/semver/node_modules/lru-cache/LICENSE similarity index 92% rename from node_modules/@npmcli/git/node_modules/lru-cache/LICENSE rename to node_modules/semver/node_modules/lru-cache/LICENSE index 9b58a3e03d1df..19129e315fe59 100644 --- a/node_modules/@npmcli/git/node_modules/lru-cache/LICENSE +++ b/node_modules/semver/node_modules/lru-cache/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors +Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/node_modules/semver/node_modules/lru-cache/index.js b/node_modules/semver/node_modules/lru-cache/index.js new file mode 100644 index 0000000000000..573b6b85b9779 --- /dev/null +++ b/node_modules/semver/node_modules/lru-cache/index.js @@ -0,0 +1,334 @@ +'use strict' + +// A linked list to keep track of recently-used-ness +const Yallist = require('yallist') + +const MAX = Symbol('max') +const LENGTH = Symbol('length') +const LENGTH_CALCULATOR = Symbol('lengthCalculator') +const ALLOW_STALE = Symbol('allowStale') +const MAX_AGE = Symbol('maxAge') +const DISPOSE = Symbol('dispose') +const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') +const LRU_LIST = Symbol('lruList') +const CACHE = Symbol('cache') +const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') + +const naiveLength = () => 1 + +// lruList is a yallist where the head is the youngest +// item, and the tail is the oldest. the list contains the Hit +// objects as the entries. +// Each Hit object has a reference to its Yallist.Node. This +// never changes. +// +// cache is a Map (or PseudoMap) that matches the keys to +// the Yallist.Node object. +class LRUCache { + constructor (options) { + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + if (options.max && (typeof options.max !== 'number' || options.max < 0)) + throw new TypeError('max must be a non-negative number') + // Kind of weird to have a default max of Infinity, but oh well. + const max = this[MAX] = options.max || Infinity + + const lc = options.length || naiveLength + this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc + this[ALLOW_STALE] = options.stale || false + if (options.maxAge && typeof options.maxAge !== 'number') + throw new TypeError('maxAge must be a number') + this[MAX_AGE] = options.maxAge || 0 + this[DISPOSE] = options.dispose + this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false + this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false + this.reset() + } + + // resize the cache when the max changes. + set max (mL) { + if (typeof mL !== 'number' || mL < 0) + throw new TypeError('max must be a non-negative number') + + this[MAX] = mL || Infinity + trim(this) + } + get max () { + return this[MAX] + } + + set allowStale (allowStale) { + this[ALLOW_STALE] = !!allowStale + } + get allowStale () { + return this[ALLOW_STALE] + } + + set maxAge (mA) { + if (typeof mA !== 'number') + throw new TypeError('maxAge must be a non-negative number') + + this[MAX_AGE] = mA + trim(this) + } + get maxAge () { + return this[MAX_AGE] + } + + // resize the cache when the lengthCalculator changes. + set lengthCalculator (lC) { + if (typeof lC !== 'function') + lC = naiveLength + + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC + this[LENGTH] = 0 + this[LRU_LIST].forEach(hit => { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) + this[LENGTH] += hit.length + }) + } + trim(this) + } + get lengthCalculator () { return this[LENGTH_CALCULATOR] } + + get length () { return this[LENGTH] } + get itemCount () { return this[LRU_LIST].length } + + rforEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].tail; walker !== null;) { + const prev = walker.prev + forEachStep(this, fn, walker, thisp) + walker = prev + } + } + + forEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].head; walker !== null;) { + const next = walker.next + forEachStep(this, fn, walker, thisp) + walker = next + } + } + + keys () { + return this[LRU_LIST].toArray().map(k => k.key) + } + + values () { + return this[LRU_LIST].toArray().map(k => k.value) + } + + reset () { + if (this[DISPOSE] && + this[LRU_LIST] && + this[LRU_LIST].length) { + this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) + } + + this[CACHE] = new Map() // hash of items by key + this[LRU_LIST] = new Yallist() // list of items in order of use recency + this[LENGTH] = 0 // length of items in the list + } + + dump () { + return this[LRU_LIST].map(hit => + isStale(this, hit) ? false : { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }).toArray().filter(h => h) + } + + dumpLru () { + return this[LRU_LIST] + } + + set (key, value, maxAge) { + maxAge = maxAge || this[MAX_AGE] + + if (maxAge && typeof maxAge !== 'number') + throw new TypeError('maxAge must be a number') + + const now = maxAge ? Date.now() : 0 + const len = this[LENGTH_CALCULATOR](value, key) + + if (this[CACHE].has(key)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key)) + return false + } + + const node = this[CACHE].get(key) + const item = node.value + + // dispose of the old one before overwriting + // split out into 2 ifs for better coverage tracking + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) + this[DISPOSE](key, item.value) + } + + item.now = now + item.maxAge = maxAge + item.value = value + this[LENGTH] += len - item.length + item.length = len + this.get(key) + trim(this) + return true + } + + const hit = new Entry(key, value, len, now, maxAge) + + // oversized objects fall out of cache automatically. + if (hit.length > this[MAX]) { + if (this[DISPOSE]) + this[DISPOSE](key, value) + + return false + } + + this[LENGTH] += hit.length + this[LRU_LIST].unshift(hit) + this[CACHE].set(key, this[LRU_LIST].head) + trim(this) + return true + } + + has (key) { + if (!this[CACHE].has(key)) return false + const hit = this[CACHE].get(key).value + return !isStale(this, hit) + } + + get (key) { + return get(this, key, true) + } + + peek (key) { + return get(this, key, false) + } + + pop () { + const node = this[LRU_LIST].tail + if (!node) + return null + + del(this, node) + return node.value + } + + del (key) { + del(this, this[CACHE].get(key)) + } + + load (arr) { + // reset the cache + this.reset() + + const now = Date.now() + // A previous serialized cache has the most recent items first + for (let l = arr.length - 1; l >= 0; l--) { + const hit = arr[l] + const expiresAt = hit.e || 0 + if (expiresAt === 0) + // the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + else { + const maxAge = expiresAt - now + // dont add already expired items + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge) + } + } + } + } + + prune () { + this[CACHE].forEach((value, key) => get(this, key, false)) + } +} + +const get = (self, key, doUse) => { + const node = self[CACHE].get(key) + if (node) { + const hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + return undefined + } else { + if (doUse) { + if (self[UPDATE_AGE_ON_GET]) + node.value.now = Date.now() + self[LRU_LIST].unshiftNode(node) + } + } + return hit.value + } +} + +const isStale = (self, hit) => { + if (!hit || (!hit.maxAge && !self[MAX_AGE])) + return false + + const diff = Date.now() - hit.now + return hit.maxAge ? diff > hit.maxAge + : self[MAX_AGE] && (diff > self[MAX_AGE]) +} + +const trim = self => { + if (self[LENGTH] > self[MAX]) { + for (let walker = self[LRU_LIST].tail; + self[LENGTH] > self[MAX] && walker !== null;) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + const prev = walker.prev + del(self, walker) + walker = prev + } + } +} + +const del = (self, node) => { + if (node) { + const hit = node.value + if (self[DISPOSE]) + self[DISPOSE](hit.key, hit.value) + + self[LENGTH] -= hit.length + self[CACHE].delete(hit.key) + self[LRU_LIST].removeNode(node) + } +} + +class Entry { + constructor (key, value, length, now, maxAge) { + this.key = key + this.value = value + this.length = length + this.now = now + this.maxAge = maxAge || 0 + } +} + +const forEachStep = (self, fn, node, thisp) => { + let hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + hit = undefined + } + if (hit) + fn.call(thisp, hit.value, hit.key, self) +} + +module.exports = LRUCache diff --git a/node_modules/semver/node_modules/lru-cache/package.json b/node_modules/semver/node_modules/lru-cache/package.json new file mode 100644 index 0000000000000..43b7502c3e7c7 --- /dev/null +++ b/node_modules/semver/node_modules/lru-cache/package.json @@ -0,0 +1,34 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "6.0.0", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "main": "index.js", + "repository": "git://github.com/isaacs/node-lru-cache.git", + "devDependencies": { + "benchmark": "^2.1.4", + "tap": "^14.10.7" + }, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "files": [ + "index.js" + ], + "engines": { + "node": ">=10" + } +} diff --git a/package-lock.json b/package-lock.json index 00f6b4d6c72a9..2b9388cad4303 100644 --- a/package-lock.json +++ b/package-lock.json @@ -97,7 +97,7 @@ "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "~1.0.0", - "cacache": "^15.3.0", + "cacache": "^16.0.1", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", @@ -106,9 +106,9 @@ "fastest-levenshtein": "^1.0.12", "glob": "^7.2.0", "graceful-fs": "^4.2.9", - "hosted-git-info": "^4.1.0", + "hosted-git-info": "^5.0.0", "ini": "^2.0.0", - "init-package-json": "^3.0.0", + "init-package-json": "^3.0.1", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", "libnpmaccess": "^6.0.1", @@ -122,7 +122,7 @@ "libnpmsearch": "^5.0.1", "libnpmteam": "^4.0.1", "libnpmversion": "^3.0.1", - "make-fetch-happen": "^10.0.5", + "make-fetch-happen": "^10.0.6", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -132,19 +132,19 @@ "nopt": "^5.0.0", "npm-audit-report": "^2.1.5", "npm-install-checks": "^4.0.0", - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "npm-pick-manifest": "^7.0.0", "npm-profile": "^6.0.2", "npm-registry-fetch": "^13.0.1", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.1", "opener": "^1.5.2", - "pacote": "^13.0.3", + "pacote": "^13.0.5", "parse-conflict-json": "^2.0.1", "proc-log": "^2.0.0", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", - "read-package-json": "^4.1.2", + "read-package-json": "^5.0.0", "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", @@ -897,15 +897,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "node_modules/@npmcli/git/node_modules/lru-cache": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.4.0.tgz", - "integrity": "sha512-YOfuyWa/Ee+PXbDm40j9WXyJrzQUynVbgn4Km643UYcWNcrSfRkKL0WaiUcxcIbkXcVTgNpDqSnPXntWXT75cw==", - "inBundle": true, - "engines": { - "node": ">=12" - } - }, "node_modules/@npmcli/installed-package-contents": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", @@ -959,13 +950,13 @@ } }, "node_modules/@npmcli/metavuln-calculator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.0.0.tgz", - "integrity": "sha512-tIzAdW3DAvlyuQyYvy7WuDKaJs55LoXFAIyglZTrHsc9DGZWP1YVL7+8WFKqx+lHyHUEkfk02Dc8ie4JWtNO6w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.0.1.tgz", + "integrity": "sha512-XnaD5UfV/qQoIEPWnfBntw8Ik5HWkxEc1wCmfHxhogdj06bwP51nAyU3QLBdhnFsmQQElqV0S8eHXn2zEXnSZw==", "dependencies": { - "cacache": "^15.3.0", + "cacache": "^16.0.0", "json-parse-even-better-errors": "^2.3.1", - "pacote": "^13.0.1", + "pacote": "^13.0.3", "semver": "^7.3.5" }, "engines": { @@ -1613,32 +1604,32 @@ "inBundle": true }, "node_modules/cacache": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.1.tgz", + "integrity": "sha512-tHPtfdZDqQpZ15eaEZeLspIqS5mK5fOBDZi6AjuqaIi53QNVXH3dQv6uKT3YuUu6uxV/8pjU9in0CoJ8fgaHqw==", "inBundle": true, "dependencies": { "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", + "@npmcli/move-file": "^1.1.2", "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", + "fs-minipass": "^2.1.0", + "glob": "^7.2.0", "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", + "lru-cache": "^7.5.1", + "minipass": "^3.1.6", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", "ssri": "^8.0.1", - "tar": "^6.0.2", + "tar": "^6.1.11", "unique-filename": "^1.1.1" }, "engines": { - "node": ">= 10" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/caching-transform": { @@ -3783,15 +3774,15 @@ } }, "node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", + "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", "inBundle": true, "dependencies": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.5.1" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/html-encoding-sniffer": { @@ -3999,15 +3990,15 @@ } }, "node_modules/init-package-json": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.0.tgz", - "integrity": "sha512-b0PZaZ3lF0mKsk7QcP03LhxXttVR0kb4XIafD1HXV4JIvLhifdvFgNyXr3qSA/3DZmiskFveLP1eXfXGFybG6g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.1.tgz", + "integrity": "sha512-TGY3Ouc/zKzanMEfA4v/4b+kaCYqMrdriQQ0iPktKeIcoIkejULFt1ounGWFoJwq2cbdCwNxZsp8vaUhuz1caQ==", "inBundle": true, "dependencies": { "npm-package-arg": "^9.0.0", "promzard": "^0.3.0", "read": "^1.0.7", - "read-package-json": "^4.1.1", + "read-package-json": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^3.0.0" @@ -4942,15 +4933,12 @@ } }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.5.1.tgz", + "integrity": "sha512-q1TS8IqKvcg3aScamKCHpepSrHF537Ww7nHahBOxhDu9D2YoBXAsj/7uFdZFj1xJr9LmyeJ62AdyofCHafUbIA==", "inBundle": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/make-dir": { @@ -4986,21 +4974,21 @@ "peer": true }, "node_modules/make-fetch-happen": { - "version": "10.0.5", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.5.tgz", - "integrity": "sha512-0JQ0daMRDFEv14DelmcFlprdhSDNG7WEgInTjBeWYWZ78W0jfDqygZdPLhcrQ4s/G8skNhBrS4fiF6xA+YlFjQ==", + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.6.tgz", + "integrity": "sha512-4Gfh6lV3TLXmj7qz79hBFuvVqjYSMW6v2+sxtdX4LFQU0rK3V/txRjE0DoZb7X0IF3t9f8NO3CxPSWlvdckhVA==", "inBundle": true, "dependencies": { "agentkeepalive": "^4.2.1", - "cacache": "^15.3.0", + "cacache": "^16.0.0", "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", - "lru-cache": "^7.4.1", + "lru-cache": "^7.5.1", "minipass": "^3.1.6", "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.2", + "minipass-fetch": "^2.0.3", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", @@ -5012,15 +5000,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "node_modules/make-fetch-happen/node_modules/lru-cache": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.4.2.tgz", - "integrity": "sha512-Xs3+hFPDSKQmL05Gs6NhvAADol1u9TmLoNoE03ZjszX6a5iYIO3rPUM4jIjoBUJeTaWEBMozjjmV70gvdRfIdw==", - "inBundle": true, - "engines": { - "node": ">=12" - } - }, "node_modules/markdown-escapes": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz", @@ -5190,9 +5169,9 @@ } }, "node_modules/minipass-fetch": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.0.2.tgz", - "integrity": "sha512-M63u5yWX0yxY1C3DcLVY1xWai0pNM3qa1xCMXFgdejY5F/NTmyzNVHGcBxKerX51lssqxwWWTjpg/ZPuD39gOQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.0.3.tgz", + "integrity": "sha512-VA+eiiUtaIvpQJXISwE3OiMvQwAWrgKb97F0aXlCS1Ahikr8fEQq8m3Hf7Kv9KT3nokuHigJKsDMB6atU04olQ==", "inBundle": true, "dependencies": { "minipass": "^3.1.6", @@ -5438,18 +5417,18 @@ } }, "node_modules/normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.0.tgz", + "integrity": "sha512-m+GL22VXJKkKbw62ZaBBjv8u6IE3UI4Mh5QakIqs3fWiKe0Xyi6L97hakwZK41/LD4R/2ly71Bayx0NLMwLA/g==", "inBundle": true, "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/normalize-path": { @@ -5507,12 +5486,12 @@ "inBundle": true }, "node_modules/npm-package-arg": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.0.tgz", - "integrity": "sha512-yhzXxeor+Zfhe5MGwPdDumz6HtNlj2pMekWB95IX3CC6uDNgde0oPKHDCLDPoJqQfd0HqAWt+y4Hs5m7CK1+9Q==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.1.tgz", + "integrity": "sha512-Xs9wznfEAmZAR61qsYH3iN24V/qMYYkvAR5CRQNMvC6PjN2fHtO8y9XP/xdp5K+Icx+u1wMBMgWRPCmAEChSog==", "inBundle": true, "dependencies": { - "hosted-git-info": "^4.1.0", + "hosted-git-info": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^3.0.0" }, @@ -5521,21 +5500,21 @@ } }, "node_modules/npm-packlist": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-3.0.0.tgz", - "integrity": "sha512-L/cbzmutAwII5glUcf2DBRNY/d0TFd4e/FnaZigJV6JD85RHZXJFGwCndjMWiiViiWSsWt3tiOLpI3ByTnIdFQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-4.0.0.tgz", + "integrity": "sha512-gL6XC/iw9YSmqArmZOGSkyy+yIZf2f7uH0p4Vmxef/irn73vd9/rDkCtvm+a9rh/QK2xGYfCAMOghM06ymzC0A==", "inBundle": true, "dependencies": { - "glob": "^7.1.6", + "glob": "^7.2.0", "ignore-walk": "^4.0.1", - "npm-bundled": "^1.1.1", + "npm-bundled": "^1.1.2", "npm-normalize-package-bin": "^1.0.1" }, "bin": { "npm-packlist": "bin/index.js" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/npm-pick-manifest": { @@ -5929,28 +5908,28 @@ } }, "node_modules/pacote": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.0.3.tgz", - "integrity": "sha512-8thQ06YoO01O1k5rvSpHS/XPJZucw2DPiiT1jI+ys8QaTN6ifAyxfyoABHBa8nIt/4wPdzly4GEPqshctHFoYA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.0.5.tgz", + "integrity": "sha512-6CYfot3/rUAn3qqzF2d/jrrXm5HlBtvaSgfmg0VtOUAdJ8fbSq21BJwftMGArkL71yXHIbUJ7Bt5B04547HELA==", "inBundle": true, "dependencies": { "@npmcli/git": "^3.0.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/promise-spawn": "^1.2.0", - "@npmcli/run-script": "^3.0.0", - "cacache": "^15.3.0", + "@npmcli/run-script": "^3.0.1", + "cacache": "^16.0.0", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", "infer-owner": "^1.0.4", "minipass": "^3.1.6", "mkdirp": "^1.0.4", "npm-package-arg": "^9.0.0", - "npm-packlist": "^3.0.0", + "npm-packlist": "^4.0.0", "npm-pick-manifest": "^7.0.0", - "npm-registry-fetch": "^13.0.0", + "npm-registry-fetch": "^13.0.1", "proc-log": "^2.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^4.1.1", + "read-package-json": "^5.0.0", "read-package-json-fast": "^2.0.3", "rimraf": "^3.0.2", "ssri": "^8.0.1", @@ -6434,18 +6413,18 @@ "integrity": "sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw==" }, "node_modules/read-package-json": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-4.1.2.tgz", - "integrity": "sha512-Dqer4pqzamDE2O4M55xp1qZMuLPqi4ldk2ya648FOMHRjwMzFhuxVrG04wd0c38IsvkVdr3vgHI6z+QTPdAjrQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.0.tgz", + "integrity": "sha512-1cjk2MV5ONDMn34uxSID3X8NY7VKsXfJnjbcVdFMvHEnJOBzU6MJ7/3yg6QFVZDq5/1yFNrKBUK9kGnonyGP2Q==", "inBundle": true, "dependencies": { - "glob": "^7.1.1", - "json-parse-even-better-errors": "^2.3.0", - "normalize-package-data": "^3.0.0", - "npm-normalize-package-bin": "^1.0.0" + "glob": "^7.2.0", + "json-parse-even-better-errors": "^2.3.1", + "normalize-package-data": "^4.0.0", + "npm-normalize-package-bin": "^1.0.1" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/read-package-json-fast": { @@ -6881,6 +6860,18 @@ "node": ">=10" } }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "inBundle": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -10387,14 +10378,14 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/map-workspaces": "^2.0.0", - "@npmcli/metavuln-calculator": "^3.0.0", + "@npmcli/metavuln-calculator": "^3.0.1", "@npmcli/move-file": "^1.1.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^1.0.3", "@npmcli/package-json": "^1.0.1", "@npmcli/run-script": "^3.0.0", "bin-links": "^3.0.0", - "cacache": "^15.0.3", + "cacache": "^16.0.0", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", @@ -10406,7 +10397,7 @@ "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.0", "npmlog": "^6.0.1", - "pacote": "^13.0.2", + "pacote": "^13.0.5", "parse-conflict-json": "^2.0.1", "proc-log": "^2.0.0", "promise-all-reject-late": "^1.0.0", @@ -10441,7 +10432,7 @@ "dependencies": { "aproba": "^2.0.0", "minipass": "^3.1.1", - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0" }, "devDependencies": { @@ -10477,8 +10468,8 @@ "binary-extensions": "^2.2.0", "diff": "^5.0.0", "minimatch": "^3.0.4", - "npm-package-arg": "^9.0.0", - "pacote": "^13.0.2", + "npm-package-arg": "^9.0.1", + "pacote": "^13.0.5", "tar": "^6.1.0" }, "devDependencies": { @@ -10499,9 +10490,9 @@ "@npmcli/run-script": "^3.0.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "npmlog": "^6.0.1", - "pacote": "^13.0.2", + "pacote": "^13.0.5", "proc-log": "^2.0.0", "read": "^1.0.7", "read-package-json-fast": "^2.0.2", @@ -10642,8 +10633,8 @@ "license": "ISC", "dependencies": { "@npmcli/run-script": "^3.0.0", - "npm-package-arg": "^9.0.0", - "pacote": "^13.0.2" + "npm-package-arg": "^9.0.1", + "pacote": "^13.0.5" }, "devDependencies": { "@npmcli/template-oss": "^2.4.2", @@ -10658,8 +10649,8 @@ "version": "6.0.1", "license": "ISC", "dependencies": { - "normalize-package-data": "^3.0.2", - "npm-package-arg": "^9.0.0", + "normalize-package-data": "^4.0.0", + "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0", "semver": "^7.1.3", "ssri": "^8.0.1" @@ -11332,7 +11323,7 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/map-workspaces": "^2.0.0", - "@npmcli/metavuln-calculator": "^3.0.0", + "@npmcli/metavuln-calculator": "^3.0.1", "@npmcli/move-file": "^1.1.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^1.0.3", @@ -11341,7 +11332,7 @@ "@npmcli/template-oss": "^2.4.2", "benchmark": "^2.1.4", "bin-links": "^3.0.0", - "cacache": "^15.0.3", + "cacache": "^16.0.0", "chalk": "^4.1.0", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", @@ -11356,7 +11347,7 @@ "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.0", "npmlog": "^6.0.1", - "pacote": "^13.0.2", + "pacote": "^13.0.5", "parse-conflict-json": "^2.0.1", "proc-log": "^2.0.0", "promise-all-reject-late": "^1.0.0", @@ -11432,13 +11423,6 @@ "promise-retry": "^2.0.1", "semver": "^7.3.5", "which": "^2.0.2" - }, - "dependencies": { - "lru-cache": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.4.0.tgz", - "integrity": "sha512-YOfuyWa/Ee+PXbDm40j9WXyJrzQUynVbgn4Km643UYcWNcrSfRkKL0WaiUcxcIbkXcVTgNpDqSnPXntWXT75cw==" - } } }, "@npmcli/installed-package-contents": { @@ -11480,13 +11464,13 @@ } }, "@npmcli/metavuln-calculator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.0.0.tgz", - "integrity": "sha512-tIzAdW3DAvlyuQyYvy7WuDKaJs55LoXFAIyglZTrHsc9DGZWP1YVL7+8WFKqx+lHyHUEkfk02Dc8ie4JWtNO6w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.0.1.tgz", + "integrity": "sha512-XnaD5UfV/qQoIEPWnfBntw8Ik5HWkxEc1wCmfHxhogdj06bwP51nAyU3QLBdhnFsmQQElqV0S8eHXn2zEXnSZw==", "requires": { - "cacache": "^15.3.0", + "cacache": "^16.0.0", "json-parse-even-better-errors": "^2.3.1", - "pacote": "^13.0.1", + "pacote": "^13.0.3", "semver": "^7.3.5" } }, @@ -11977,27 +11961,27 @@ "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=" }, "cacache": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.1.tgz", + "integrity": "sha512-tHPtfdZDqQpZ15eaEZeLspIqS5mK5fOBDZi6AjuqaIi53QNVXH3dQv6uKT3YuUu6uxV/8pjU9in0CoJ8fgaHqw==", "requires": { "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", + "@npmcli/move-file": "^1.1.2", "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", + "fs-minipass": "^2.1.0", + "glob": "^7.2.0", "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", + "lru-cache": "^7.5.1", + "minipass": "^3.1.6", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", "ssri": "^8.0.1", - "tar": "^6.0.2", + "tar": "^6.1.11", "unique-filename": "^1.1.1" } }, @@ -13591,11 +13575,11 @@ } }, "hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", + "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", "requires": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.5.1" } }, "html-encoding-sniffer": { @@ -13736,14 +13720,14 @@ "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==" }, "init-package-json": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.0.tgz", - "integrity": "sha512-b0PZaZ3lF0mKsk7QcP03LhxXttVR0kb4XIafD1HXV4JIvLhifdvFgNyXr3qSA/3DZmiskFveLP1eXfXGFybG6g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.1.tgz", + "integrity": "sha512-TGY3Ouc/zKzanMEfA4v/4b+kaCYqMrdriQQ0iPktKeIcoIkejULFt1ounGWFoJwq2cbdCwNxZsp8vaUhuz1caQ==", "requires": { "npm-package-arg": "^9.0.0", "promzard": "^0.3.0", "read": "^1.0.7", - "read-package-json": "^4.1.1", + "read-package-json": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^3.0.0" @@ -14297,7 +14281,7 @@ "aproba": "^2.0.0", "minipass": "^3.1.1", "nock": "^12.0.1", - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0", "tap": "^15.1.0" }, @@ -14326,8 +14310,8 @@ "diff": "^5.0.0", "eslint": "^8.1.0", "minimatch": "^3.0.4", - "npm-package-arg": "^9.0.0", - "pacote": "^13.0.2", + "npm-package-arg": "^9.0.1", + "pacote": "^13.0.5", "tap": "^15.0.9", "tar": "^6.1.0" } @@ -14342,9 +14326,9 @@ "bin-links": "^3.0.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "npmlog": "^6.0.1", - "pacote": "^13.0.2", + "pacote": "^13.0.5", "proc-log": "^2.0.0", "read": "^1.0.7", "read-package-json-fast": "^2.0.2", @@ -14450,8 +14434,8 @@ "@npmcli/run-script": "^3.0.0", "@npmcli/template-oss": "^2.4.2", "nock": "^13.0.7", - "npm-package-arg": "^9.0.0", - "pacote": "^13.0.2", + "npm-package-arg": "^9.0.1", + "pacote": "^13.0.5", "tap": "^15.0.0" } }, @@ -14462,8 +14446,8 @@ "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^12.0.2", - "normalize-package-data": "^3.0.2", - "npm-package-arg": "^9.0.0", + "normalize-package-data": "^4.0.0", + "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0", "semver": "^7.1.3", "ssri": "^8.0.1", @@ -14684,12 +14668,9 @@ "dev": true }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.5.1.tgz", + "integrity": "sha512-q1TS8IqKvcg3aScamKCHpepSrHF537Ww7nHahBOxhDu9D2YoBXAsj/7uFdZFj1xJr9LmyeJ62AdyofCHafUbIA==" }, "make-dir": { "version": "3.1.0", @@ -14717,33 +14698,26 @@ "peer": true }, "make-fetch-happen": { - "version": "10.0.5", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.5.tgz", - "integrity": "sha512-0JQ0daMRDFEv14DelmcFlprdhSDNG7WEgInTjBeWYWZ78W0jfDqygZdPLhcrQ4s/G8skNhBrS4fiF6xA+YlFjQ==", + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.6.tgz", + "integrity": "sha512-4Gfh6lV3TLXmj7qz79hBFuvVqjYSMW6v2+sxtdX4LFQU0rK3V/txRjE0DoZb7X0IF3t9f8NO3CxPSWlvdckhVA==", "requires": { "agentkeepalive": "^4.2.1", - "cacache": "^15.3.0", + "cacache": "^16.0.0", "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", - "lru-cache": "^7.4.1", + "lru-cache": "^7.5.1", "minipass": "^3.1.6", "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.2", + "minipass-fetch": "^2.0.3", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.1.1", "ssri": "^8.0.1" - }, - "dependencies": { - "lru-cache": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.4.2.tgz", - "integrity": "sha512-Xs3+hFPDSKQmL05Gs6NhvAADol1u9TmLoNoE03ZjszX6a5iYIO3rPUM4jIjoBUJeTaWEBMozjjmV70gvdRfIdw==" - } } }, "markdown-escapes": { @@ -14864,9 +14838,9 @@ } }, "minipass-fetch": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.0.2.tgz", - "integrity": "sha512-M63u5yWX0yxY1C3DcLVY1xWai0pNM3qa1xCMXFgdejY5F/NTmyzNVHGcBxKerX51lssqxwWWTjpg/ZPuD39gOQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.0.3.tgz", + "integrity": "sha512-VA+eiiUtaIvpQJXISwE3OiMvQwAWrgKb97F0aXlCS1Ahikr8fEQq8m3Hf7Kv9KT3nokuHigJKsDMB6atU04olQ==", "requires": { "encoding": "^0.1.13", "minipass": "^3.1.6", @@ -15048,14 +15022,14 @@ } }, "normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.0.tgz", + "integrity": "sha512-m+GL22VXJKkKbw62ZaBBjv8u6IE3UI4Mh5QakIqs3fWiKe0Xyi6L97hakwZK41/LD4R/2ly71Bayx0NLMwLA/g==", "requires": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" } }, "normalize-path": { @@ -15100,23 +15074,23 @@ "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" }, "npm-package-arg": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.0.tgz", - "integrity": "sha512-yhzXxeor+Zfhe5MGwPdDumz6HtNlj2pMekWB95IX3CC6uDNgde0oPKHDCLDPoJqQfd0HqAWt+y4Hs5m7CK1+9Q==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.1.tgz", + "integrity": "sha512-Xs9wznfEAmZAR61qsYH3iN24V/qMYYkvAR5CRQNMvC6PjN2fHtO8y9XP/xdp5K+Icx+u1wMBMgWRPCmAEChSog==", "requires": { - "hosted-git-info": "^4.1.0", + "hosted-git-info": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^3.0.0" } }, "npm-packlist": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-3.0.0.tgz", - "integrity": "sha512-L/cbzmutAwII5glUcf2DBRNY/d0TFd4e/FnaZigJV6JD85RHZXJFGwCndjMWiiViiWSsWt3tiOLpI3ByTnIdFQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-4.0.0.tgz", + "integrity": "sha512-gL6XC/iw9YSmqArmZOGSkyy+yIZf2f7uH0p4Vmxef/irn73vd9/rDkCtvm+a9rh/QK2xGYfCAMOghM06ymzC0A==", "requires": { - "glob": "^7.1.6", + "glob": "^7.2.0", "ignore-walk": "^4.0.1", - "npm-bundled": "^1.1.1", + "npm-bundled": "^1.1.2", "npm-normalize-package-bin": "^1.0.1" } }, @@ -15409,27 +15383,27 @@ } }, "pacote": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.0.3.tgz", - "integrity": "sha512-8thQ06YoO01O1k5rvSpHS/XPJZucw2DPiiT1jI+ys8QaTN6ifAyxfyoABHBa8nIt/4wPdzly4GEPqshctHFoYA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.0.5.tgz", + "integrity": "sha512-6CYfot3/rUAn3qqzF2d/jrrXm5HlBtvaSgfmg0VtOUAdJ8fbSq21BJwftMGArkL71yXHIbUJ7Bt5B04547HELA==", "requires": { "@npmcli/git": "^3.0.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/promise-spawn": "^1.2.0", - "@npmcli/run-script": "^3.0.0", - "cacache": "^15.3.0", + "@npmcli/run-script": "^3.0.1", + "cacache": "^16.0.0", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", "infer-owner": "^1.0.4", "minipass": "^3.1.6", "mkdirp": "^1.0.4", "npm-package-arg": "^9.0.0", - "npm-packlist": "^3.0.0", + "npm-packlist": "^4.0.0", "npm-pick-manifest": "^7.0.0", - "npm-registry-fetch": "^13.0.0", + "npm-registry-fetch": "^13.0.1", "proc-log": "^2.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^4.1.1", + "read-package-json": "^5.0.0", "read-package-json-fast": "^2.0.3", "rimraf": "^3.0.2", "ssri": "^8.0.1", @@ -15803,14 +15777,14 @@ "integrity": "sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw==" }, "read-package-json": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-4.1.2.tgz", - "integrity": "sha512-Dqer4pqzamDE2O4M55xp1qZMuLPqi4ldk2ya648FOMHRjwMzFhuxVrG04wd0c38IsvkVdr3vgHI6z+QTPdAjrQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.0.tgz", + "integrity": "sha512-1cjk2MV5ONDMn34uxSID3X8NY7VKsXfJnjbcVdFMvHEnJOBzU6MJ7/3yg6QFVZDq5/1yFNrKBUK9kGnonyGP2Q==", "requires": { - "glob": "^7.1.1", - "json-parse-even-better-errors": "^2.3.0", - "normalize-package-data": "^3.0.0", - "npm-normalize-package-bin": "^1.0.0" + "glob": "^7.2.0", + "json-parse-even-better-errors": "^2.3.1", + "normalize-package-data": "^4.0.0", + "npm-normalize-package-bin": "^1.0.1" } }, "read-package-json-fast": { @@ -16131,6 +16105,16 @@ "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "requires": { "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + } } }, "set-blocking": { diff --git a/package.json b/package.json index d7e2f8b03fa06..faf59dc5d34d4 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "~1.0.0", - "cacache": "^15.3.0", + "cacache": "^16.0.1", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", @@ -74,9 +74,9 @@ "fastest-levenshtein": "^1.0.12", "glob": "^7.2.0", "graceful-fs": "^4.2.9", - "hosted-git-info": "^4.1.0", + "hosted-git-info": "^5.0.0", "ini": "^2.0.0", - "init-package-json": "^3.0.0", + "init-package-json": "^3.0.1", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", "libnpmaccess": "^6.0.1", @@ -90,7 +90,7 @@ "libnpmsearch": "^5.0.1", "libnpmteam": "^4.0.1", "libnpmversion": "^3.0.1", - "make-fetch-happen": "^10.0.5", + "make-fetch-happen": "^10.0.6", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -100,19 +100,19 @@ "nopt": "^5.0.0", "npm-audit-report": "^2.1.5", "npm-install-checks": "^4.0.0", - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "npm-pick-manifest": "^7.0.0", "npm-profile": "^6.0.2", "npm-registry-fetch": "^13.0.1", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.1", "opener": "^1.5.2", - "pacote": "^13.0.3", + "pacote": "^13.0.5", "parse-conflict-json": "^2.0.1", "proc-log": "^2.0.0", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", - "read-package-json": "^4.1.2", + "read-package-json": "^5.0.0", "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 3a4c83f553f32..b4bd00db06880 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -6,14 +6,14 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/map-workspaces": "^2.0.0", - "@npmcli/metavuln-calculator": "^3.0.0", + "@npmcli/metavuln-calculator": "^3.0.1", "@npmcli/move-file": "^1.1.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^1.0.3", "@npmcli/package-json": "^1.0.1", "@npmcli/run-script": "^3.0.0", "bin-links": "^3.0.0", - "cacache": "^15.0.3", + "cacache": "^16.0.0", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", @@ -25,7 +25,7 @@ "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.0", "npmlog": "^6.0.1", - "pacote": "^13.0.2", + "pacote": "^13.0.5", "parse-conflict-json": "^2.0.1", "proc-log": "^2.0.0", "promise-all-reject-late": "^1.0.0", diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index ac5e8e7b21247..6ee76c86cc7a7 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -33,7 +33,7 @@ "dependencies": { "aproba": "^2.0.0", "minipass": "^3.1.1", - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0" }, "engines": { diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index d1f9a92d289be..8bf47df1200bf 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -58,8 +58,8 @@ "binary-extensions": "^2.2.0", "diff": "^5.0.0", "minimatch": "^3.0.4", - "npm-package-arg": "^9.0.0", - "pacote": "^13.0.2", + "npm-package-arg": "^9.0.1", + "pacote": "^13.0.5", "tar": "^6.1.0" }, "templateOSS": { diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 4f607099b10e3..68b88578b4764 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -60,9 +60,9 @@ "@npmcli/run-script": "^3.0.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "npmlog": "^6.0.1", - "pacote": "^13.0.2", + "pacote": "^13.0.5", "proc-log": "^2.0.0", "read": "^1.0.7", "read-package-json-fast": "^2.0.2", diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 9f7e56a1ad4dd..c25e1ef112904 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -41,8 +41,8 @@ "homepage": "https://npmjs.com/package/libnpmpack", "dependencies": { "@npmcli/run-script": "^3.0.0", - "npm-package-arg": "^9.0.0", - "pacote": "^13.0.2" + "npm-package-arg": "^9.0.1", + "pacote": "^13.0.5" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 441a10b17c0a4..59f584571617b 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -44,8 +44,8 @@ "bugs": "https://github.com/npm/cli/issues", "homepage": "https://npmjs.com/package/libnpmpublish", "dependencies": { - "normalize-package-data": "^3.0.2", - "npm-package-arg": "^9.0.0", + "normalize-package-data": "^4.0.0", + "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0", "semver": "^7.1.3", "ssri": "^8.0.1"