Astro+Directus(Visual-Editing)+Snipcart Test-Stack

This commit is contained in:
till committed 2026-06-21 06:27:52 +00:00
commit 1459e99cb0
10119 files changed
+1499318

No files matched your search

+1
View File
@@ -0,0 +1 @@
"use strict";const node_buffer=require("node:buffer");exports.Buffer=node_buffer.Buffer;
+2
View File
@@ -0,0 +1,2 @@
export { Buffer } from 'node:buffer';
import 'node:events';
+2
View File
@@ -0,0 +1,2 @@
export { Buffer } from 'node:buffer';
import 'node:events';
+2
View File
@@ -0,0 +1,2 @@
export { Buffer } from 'node:buffer';
import 'node:events';
+1
View File
@@ -0,0 +1 @@
export{Buffer}from"node:buffer";
+1
View File
@@ -0,0 +1 @@
"use strict";const a$1=[],l=[],x$1=typeof Uint8Array>"u"?Array:Uint8Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0,e=i.length;t<e;++t)a$1[t]=i[t],l[i.charCodeAt(t)]=t;l[45]=62,l[95]=63;function d$1(t){const e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");let n=t.indexOf("=");n===-1&&(n=e);const o=n===e?0:4-n%4;return[n,o]}function p(t,e,n){return(e+n)*3/4-n}function toByteArray(t){let e;const n=d$1(t),o=n[0],r=n[1],f=new x$1(p(t,o,r));let h=0;const E=r>0?o-4:o;let U;for(U=0;U<E;U+=4)e=l[t.charCodeAt(U)]<<18|l[t.charCodeAt(U+1)]<<12|l[t.charCodeAt(U+2)]<<6|l[t.charCodeAt(U+3)],f[h++]=e>>16&255,f[h++]=e>>8&255,f[h++]=e&255;return r===2&&(e=l[t.charCodeAt(U)]<<2|l[t.charCodeAt(U+1)]>>4,f[h++]=e&255),r===1&&(e=l[t.charCodeAt(U)]<<10|l[t.charCodeAt(U+1)]<<4|l[t.charCodeAt(U+2)]>>2,f[h++]=e>>8&255,f[h++]=e&255),f}function u(t){return a$1[t>>18&63]+a$1[t>>12&63]+a$1[t>>6&63]+a$1[t&63]}function A$1(t,e,n){let o;const r=[];for(let f=e;f<n;f+=3)o=(t[f]<<16&16711680)+(t[f+1]<<8&65280)+(t[f+2]&255),r.push(u(o));return r.join("")}function fromByteArray(t){let e;const n=t.length,o=n%3,r=[],f=16383;for(let h=0,E=n-o;h<E;h+=f)r.push(A$1(t,h,h+f>E?E:h+f));return o===1?(e=t[n-1],r.push(a$1[e>>2]+a$1[e<<4&63]+"==")):o===2&&(e=(t[n-2]<<8)+t[n-1],r.push(a$1[e>>10]+a$1[e>>4&63]+a$1[e<<2&63]+"=")),r.join("")}/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function read(t,e,n,o,r){let f,h;const E=r*8-o-1,U=(1<<E)-1,et=U>>1;let c=-7,tt=n?r-1:0;const ot=n?-1:1;let nt=t[e+tt];for(tt+=ot,f=nt&(1<<-c)-1,nt>>=-c,c+=E;c>0;)f=f*256+t[e+tt],tt+=ot,c-=8;for(h=f&(1<<-c)-1,f>>=-c,c+=o;c>0;)h=h*256+t[e+tt],tt+=ot,c-=8;if(f===0)f=1-et;else{if(f===U)return h?Number.NaN:(nt?-1:1)*Number.POSITIVE_INFINITY;h=h+Math.pow(2,o),f=f-et}return(nt?-1:1)*h*Math.pow(2,f-o)}function write(t,e,n,o,r,f){let h,E,U,et=f*8-r-1;const c=(1<<et)-1,tt=c>>1,ot=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;let nt=o?0:f-1;const rt=o?1:-1,it=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),Number.isNaN(e)||e===Number.POSITIVE_INFINITY?(E=Number.isNaN(e)?1:0,h=c):(h=Math.floor(Math.log2(e)),e*(U=Math.pow(2,-h))<1&&(h--,U*=2),e+=h+tt>=1?ot/U:ot*Math.pow(2,1-tt),e*U>=2&&(h++,U/=2),h+tt>=c?(E=0,h=c):h+tt>=1?(E=(e*U-1)*Math.pow(2,r),h=h+tt):(E=e*Math.pow(2,tt-1)*Math.pow(2,r),h=0));r>=8;)t[n+nt]=E&255,nt+=rt,E/=256,r-=8;for(h=h<<r|E,et+=r;et>0;)t[n+nt]=h&255,nt+=rt,h/=256,et-=8;t[n+nt-rt]|=it*128}const $=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,INSPECT_MAX_BYTES=50,I=2147483647;Buffer.TYPED_ARRAY_SUPPORT=J(),!Buffer.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This environment lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function J(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}});function w(t){if(t>I)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,Buffer.prototype),e}function Buffer(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return A(t)}return k(t,e,n)}Buffer.poolSize=8192;function k(t,e,n){if(typeof t=="string")return K(t,e);if(ArrayBuffer.isView(t))return Q(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(a(t,ArrayBuffer)||t&&a(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(a(t,SharedArrayBuffer)||t&&a(t.buffer,SharedArrayBuffer)))return T(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const o=t.valueOf&&t.valueOf();if(o!=null&&o!==t)return Buffer.from(o,e,n);const r=Z(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return Buffer.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}Buffer.from=function(t,e,n){return k(t,e,n)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array);function C(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function z(t,e,n){return C(t),t<=0?w(t):e!==void 0?typeof n==Line truncated
+25
View File
@@ -0,0 +1,25 @@
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
declare function Buffer(arg: any, encodingOrOffset: any, length: any): any;
declare namespace Buffer {
var TYPED_ARRAY_SUPPORT: boolean;
var poolSize: number;
var from: (value: any, encodingOrOffset: any, length?: any) => any;
var alloc: (size: any, fill: any, encoding: any) => Uint8Array<any>;
var allocUnsafe: (size: any) => Uint8Array<any>;
var allocUnsafeSlow: (size: any) => Uint8Array<any>;
var isBuffer: (b: any) => boolean;
var compare: (a: any, b: any) => 0 | 1 | -1;
var isEncoding: (encoding: any) => boolean;
var concat: (list: any, length?: any) => Uint8Array<any>;
var byteLength: (string: any, encoding: any) => any;
}
export { Buffer };
+25
View File
@@ -0,0 +1,25 @@
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
declare function Buffer(arg: any, encodingOrOffset: any, length: any): any;
declare namespace Buffer {
var TYPED_ARRAY_SUPPORT: boolean;
var poolSize: number;
var from: (value: any, encodingOrOffset: any, length?: any) => any;
var alloc: (size: any, fill: any, encoding: any) => Uint8Array<any>;
var allocUnsafe: (size: any) => Uint8Array<any>;
var allocUnsafeSlow: (size: any) => Uint8Array<any>;
var isBuffer: (b: any) => boolean;
var compare: (a: any, b: any) => 0 | 1 | -1;
var isEncoding: (encoding: any) => boolean;
var concat: (list: any, length?: any) => Uint8Array<any>;
var byteLength: (string: any, encoding: any) => any;
}
export { Buffer };
+25
View File
@@ -0,0 +1,25 @@
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
declare function Buffer(arg: any, encodingOrOffset: any, length: any): any;
declare namespace Buffer {
var TYPED_ARRAY_SUPPORT: boolean;
var poolSize: number;
var from: (value: any, encodingOrOffset: any, length?: any) => any;
var alloc: (size: any, fill: any, encoding: any) => Uint8Array<any>;
var allocUnsafe: (size: any) => Uint8Array<any>;
var allocUnsafeSlow: (size: any) => Uint8Array<any>;
var isBuffer: (b: any) => boolean;
var compare: (a: any, b: any) => 0 | 1 | -1;
var isEncoding: (encoding: any) => boolean;
var concat: (list: any, length?: any) => Uint8Array<any>;
var byteLength: (string: any, encoding: any) => any;
}
export { Buffer };
+1
View File
@@ -0,0 +1 @@
const d=[],y=[],ot=typeof Uint8Array>"u"?Array:Uint8Array,L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0,e=L.length;t<e;++t)d[t]=L[t],y[L.charCodeAt(t)]=t;y[45]=62,y[95]=63;function rt(t){const e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");let n=t.indexOf("=");n===-1&&(n=e);const o=n===e?0:4-n%4;return[n,o]}function it(t,e,n){return(e+n)*3/4-n}function ft(t){let e;const n=rt(t),o=n[0],r=n[1],i=new ot(it(t,o,r));let u=0;const h=r>0?o-4:o;let c;for(c=0;c<h;c+=4)e=y[t.charCodeAt(c)]<<18|y[t.charCodeAt(c+1)]<<12|y[t.charCodeAt(c+2)]<<6|y[t.charCodeAt(c+3)],i[u++]=e>>16&255,i[u++]=e>>8&255,i[u++]=e&255;return r===2&&(e=y[t.charCodeAt(c)]<<2|y[t.charCodeAt(c+1)]>>4,i[u++]=e&255),r===1&&(e=y[t.charCodeAt(c)]<<10|y[t.charCodeAt(c+1)]<<4|y[t.charCodeAt(c+2)]>>2,i[u++]=e>>8&255,i[u++]=e&255),i}function ut(t){return d[t>>18&63]+d[t>>12&63]+d[t>>6&63]+d[t&63]}function st(t,e,n){let o;const r=[];for(let i=e;i<n;i+=3)o=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),r.push(ut(o));return r.join("")}function P(t){let e;const n=t.length,o=n%3,r=[],i=16383;for(let u=0,h=n-o;u<h;u+=i)r.push(st(t,u,u+i>h?h:u+i));return o===1?(e=t[n-1],r.push(d[e>>2]+d[e<<4&63]+"==")):o===2&&(e=(t[n-2]<<8)+t[n-1],r.push(d[e>>10]+d[e>>4&63]+d[e<<2&63]+"=")),r.join("")}/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function R(t,e,n,o,r){let i,u;const h=r*8-o-1,c=(1<<h)-1,l=c>>1;let s=-7,a=n?r-1:0;const I=n?-1:1;let w=t[e+a];for(a+=I,i=w&(1<<-s)-1,w>>=-s,s+=h;s>0;)i=i*256+t[e+a],a+=I,s-=8;for(u=i&(1<<-s)-1,i>>=-s,s+=o;s>0;)u=u*256+t[e+a],a+=I,s-=8;if(i===0)i=1-l;else{if(i===c)return u?Number.NaN:(w?-1:1)*Number.POSITIVE_INFINITY;u=u+Math.pow(2,o),i=i-l}return(w?-1:1)*u*Math.pow(2,i-o)}function F(t,e,n,o,r,i){let u,h,c,l=i*8-r-1;const s=(1<<l)-1,a=s>>1,I=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;let w=o?0:i-1;const O=o?1:-1,nt=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),Number.isNaN(e)||e===Number.POSITIVE_INFINITY?(h=Number.isNaN(e)?1:0,u=s):(u=Math.floor(Math.log2(e)),e*(c=Math.pow(2,-u))<1&&(u--,c*=2),e+=u+a>=1?I/c:I*Math.pow(2,1-a),e*c>=2&&(u++,c/=2),u+a>=s?(h=0,u=s):u+a>=1?(h=(e*c-1)*Math.pow(2,r),u=u+a):(h=e*Math.pow(2,a-1)*Math.pow(2,r),u=0));r>=8;)t[n+w]=h&255,w+=O,h/=256,r-=8;for(u=u<<r|h,l+=r;l>0;)t[n+w]=u&255,w+=O,u/=256,l-=8;t[n+w-O]|=nt*128}const k=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,ht=50,N=2147483647;f.TYPED_ARRAY_SUPPORT=ct(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This environment lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ct(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function m(t){if(t>N)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(t)}return j(t,e,n)}f.poolSize=8192;function j(t,e,n){if(typeof t=="string")return lt(t,e);if(ArrayBuffer.isView(t))return pt(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(b(t,ArrayBuffer)||t&&b(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(b(t,SharedArrayBuffer)||t&&b(t.buffer,SharedArrayBuffer)))return Y(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const o=t.valueOf&&t.valueOf();if(o!=null&&o!==t)return f.from(o,e,n);const r=gt(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return f.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}f.from=function(t,e,n){return j(t,e,n)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function D(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function at(t,e,n){return D(t),t<=0?m(t):e!==void 0?typeof n=="string"?m(t).fill(e,n):m(t).fill(e):m(t)}f.alloc=function(t,e,n){return at(t,e,n)};function S(t){return D(t),m(t<0?0:x(t)|0)}f.allocUnsafe=function(t){return S(t)},f.allocUnsafeSlow=functLine truncated
+1
View File
@@ -0,0 +1 @@
"use strict";const node_events=require("node:events");exports.EventEmitter=node_events.EventEmitter;
+1
View File
@@ -0,0 +1 @@
export { EventEmitter } from 'node:events';
+1
View File
@@ -0,0 +1 @@
export { EventEmitter } from 'node:events';
+1
View File
@@ -0,0 +1 @@
export { EventEmitter } from 'node:events';
+1
View File
@@ -0,0 +1 @@
export{EventEmitter}from"node:events";
+5
View File
@@ -0,0 +1,5 @@
"use strict";let y=10;const Y=Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})()))),F=(e,t)=>e,g=Error,J=Error,h=Error,b=Error,Z=Error,R=Symbol.for("nodejs.rejection"),l=Symbol.for("kCapture"),A=Symbol.for("events.errorMonitor"),p=Symbol.for("shapeMode"),w=Symbol.for("events.maxEventTargetListeners"),ee=Symbol.for("kEnhanceStackBeforeInspector"),te=Symbol.for("nodejs.watermarkData"),E=Symbol.for("kAsyncResource"),ne=Symbol.for("kFirstEventParam"),N=Symbol.for("kResistStopPropagation"),W=Symbol.for("events.maxEventTargetListenersWarned");class EventEmitter{_events=void 0;_eventsCount=0;_maxListeners=y;[l]=!1;[p]=!1;static captureRejectionSymbol=R;static errorMonitor=A;static kMaxEventTargetListeners=w;static kMaxEventTargetListenersWarned=W;static usingDomains=!1;static get on(){return on}static get once(){return once}static get getEventListeners(){return getEventListeners}static get getMaxListeners(){return getMaxListeners}static get addAbortListener(){return addAbortListener}static get EventEmitterAsyncResource(){return EventEmitterAsyncResource}static get EventEmitter(){return EventEmitter}static setMaxListeners(t=y,...r){if(r.length===0)y=t;else for(const n of r)if($(n))n[w]=t,n[W]=!1;else if(typeof n.setMaxListeners=="function")n.setMaxListeners(t);else throw new h("eventTargets",["EventEmitter","EventTarget"],n)}static listenerCount(t,r){if(typeof t.listenerCount=="function")return t.listenerCount(r);EventEmitter.prototype.listenerCount.call(t,r)}static init(){throw new Error("EventEmitter.init() is not implemented.")}static get captureRejections(){return this[l]}static set captureRejections(t){this[l]=t}static get defaultMaxListeners(){return y}static set defaultMaxListeners(t){y=t}constructor(t){this._events===void 0||this._events===Object.getPrototypeOf(this)._events?(this._events={__proto__:null},this._eventsCount=0,this[p]=!1):this[p]=!0,this._maxListeners=this._maxListeners||void 0,t?.captureRejections?this[l]=!!t.captureRejections:this[l]=EventEmitter.prototype[l]}setMaxListeners(t){return this._maxListeners=t,this}getMaxListeners(){return S(this)}emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n&&s[A]!==void 0&&this.emit(A,...r),n=n&&s.error===void 0;else if(!n)return!1;if(n){let i;if(r.length>0&&(i=r[0]),i instanceof Error){try{const f={};Error.captureStackTrace?.(f,EventEmitter.prototype.emit),Object.defineProperty(i,ee,{__proto__:null,value:Function.prototype.bind(re,this,i,f),configurable:!0})}catch{}throw i}let u;try{u=F(i)}catch{u=i}const a=new J(u);throw a.context=i,a}const o=s[t];if(o===void 0)return!1;if(typeof o=="function"){const i=o.apply(this,r);i!=null&&H(this,i,t,r)}else{const i=o.length,u=C(o);for(let a=0;a<i;++a){const f=u[a].apply(this,r);f!=null&&H(this,f,t,r)}}return!0}addListener(t,r){return z(this,t,r,!1),this}on(t,r){return this.addListener(t,r)}prependListener(t,r){return z(this,t,r,!0),this}once(t,r){return this.on(t,U(this,t,r)),this}prependOnceListener(t,r){return this.prependListener(t,U(this,t,r)),this}removeListener(t,r){const n=this._events;if(n===void 0)return this;const s=n[t];if(s===void 0)return this;if(s===r||s.listener===r)this._eventsCount-=1,this[p]?n[t]=void 0:this._eventsCount===0?this._events={__proto__:null}:(delete n[t],n.removeListener&&this.emit("removeListener",t,s.listener||r));else if(typeof s!="function"){let o=-1;for(let i=s.length-1;i>=0;i--)if(s[i]===r||s[i].listener===r){o=i;break}if(o<0)return this;o===0?s.shift():ce(s,o),s.length===1&&(n[t]=s[0]),n.removeListener!==void 0&&this.emit("removeListener",t,r)}return this}off(t,r){return this.removeListener(t,r)}removeAllListeners(t){const r=this._events;if(r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events={__proto__:null},this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events={__proto__:null}:delete r[t]),this[p]=!1,this;if(arguments.length===0){for(const s of Reflect.ownKeys(r))s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventsCount=0,this[p]=!1,this}const n=r[t];if(typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(let s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this}listeners(t){return G(this,t,!0)}rawListeners(t){return G(this,t,!1)}eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}listenerCount(t,r){const n=this._events;if(n!==void 0){const s=n[t];if(typeof s=="function")return r!=null?r===s||r===s.listener?1:0:1;if(s!==void 0){if(r!=null){let o=0;for(let i=0,u=s.length;i<u;i++)(s[i]===r||s[i].listener===r)&&o++;return o}return s.length}}return 0}}class EventEmitterAsyncResource extends EventEmitter{constructor(t){let r;typeof t=="string"?(r=t,t=void 0):r=t?.name||new.target.name,super(t),this[E]=new EventEmitterReferencingAsyncResource(this,r,t)}emit(t,...r){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");const{asynLine truncated
Emitted 'error' event${r} at:
`,s=(t.stack||"").split(`
`).slice(1);return e.stack+n+s.join(`
`)}function z(e,t,r,n){let s,o,i;if(o=e._events,o===void 0?(o=e._events={__proto__:null},e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener??r),o=e._events),i=o[t]),i===void 0)o[t]=r,++e._eventsCount;else if(typeof i=="function"?i=o[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),s=S(e),s>0&&i.length>s&&!i.warned){i.warned=!0;const u=new Z(`Possible EventEmitter memory leak detected. ${i.length} ${String(t)} listeners added to ${F(e)}. MaxListeners is ${s}. Use emitter.setMaxListeners() to increase limit`,{name:"MaxListenersExceededWarning",emitter:e,type:t,count:i.length});process.emitWarning(u)}return e}function ie(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function U(e,t,r){const n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=ie.bind(n);return s.listener=r,n.wrapFn=s,s}function G(e,t,r){const n=e._events;if(n===void 0)return[];const s=n[t];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?oe(s):C(s)}function C(e){switch(e.length){case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];case 4:return[e[0],e[1],e[2],e[3]];case 5:return[e[0],e[1],e[2],e[3],e[4]];case 6:return[e[0],e[1],e[2],e[3],e[4],e[5]]}return Array.prototype.slice.call(e)}function oe(e){const t=C(e);for(let r=0;r<t.length;++r){const n=t[r].listener;typeof n=="function"&&(t[r]=n)}return t}function T(e,t){return{value:e,done:t}}function L(e,t,r,n){if(typeof e.removeListener=="function")e.removeListener(t,r);else if(typeof e.removeEventListener=="function")e.removeEventListener(t,r,n);else throw new h("emitter","EventEmitter",e)}function P(e,t,r,n){if(typeof e.on=="function")n?.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,r,n);else throw new h("emitter","EventEmitter",e)}function ue(){const e=[];return{addEventListener(t,r,n,s){P(t,r,n,s),Array.prototype.push(e,[t,r,n,s])},removeAll(){for(;e.length>0;)Reflect.apply(L,void 0,e.pop())}}}function ce(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}exports.EventEmitter=EventEmitter;
+141
View File
@@ -0,0 +1,141 @@
import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
declare const kCapture: unique symbol;
declare const kShapeMode: unique symbol;
type Listener = (...args: any[]) => void;
declare class EventEmitter implements EventEmitter$1 {
_events: any;
_eventsCount: number;
_maxListeners: number | undefined;
[kCapture]: boolean;
[kShapeMode]: boolean;
static captureRejectionSymbol: symbol;
static errorMonitor: symbol;
static kMaxEventTargetListeners: symbol;
static kMaxEventTargetListenersWarned: symbol;
static usingDomains: boolean;
static get on(): typeof nodeEvents.on;
static get once(): typeof nodeEvents.once;
static get getEventListeners(): typeof nodeEvents.getEventListeners;
static get getMaxListeners(): typeof nodeEvents.getMaxListeners;
static get addAbortListener(): typeof nodeEvents.addAbortListener;
static get EventEmitterAsyncResource(): typeof EventEmitterAsyncResource;
static get EventEmitter(): typeof EventEmitter;
static setMaxListeners(n?: number, ...eventTargets: (EventEmitter | EventTarget)[]): void;
static listenerCount(emitter: EventEmitter$1, type: string): number | undefined;
static init(): void;
static get captureRejections(): any;
static set captureRejections(value: any);
static get defaultMaxListeners(): number;
static set defaultMaxListeners(arg: number);
constructor(opts?: any);
/**
* Increases the max listeners of the event emitter.
* @param {number} n
* @returns {EventEmitter}
*/
setMaxListeners(n: number): this;
/**
* Returns the current max listener value for the event emitter.
* @returns {number}
*/
getMaxListeners(): number;
/**
* Synchronously calls each of the listeners registered
* for the event.
* @param {...any} [args]
* @returns {boolean}
*/
emit(type: string | symbol, ...args: any[]): boolean;
/**
* Adds a listener to the event emitter.
* @returns {EventEmitter}
*/
addListener(type: string | symbol, listener: Listener): this;
on(type: string | symbol, listener: Listener): this;
/**
* Adds the `listener` function to the beginning of
* the listeners array.
*/
prependListener(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the event emitter.
*/
once(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the beginning of
* the listeners array.
*/
prependOnceListener(type: string | symbol, listener: Listener): this;
/**
* Removes the specified `listener` from the listeners array.
* @param {string | symbol} type
* @param {Function} listener
* @returns {EventEmitter}
*/
removeListener(type: string | symbol, listener: Listener): this;
off(type: string | symbol, listener: Listener): this;
/**
* Removes all listeners from the event emitter. (Only
* removes listeners for a specific event name if specified
* as `type`).
*/
removeAllListeners(type?: string | symbol): this;
/**
* Returns a copy of the array of listeners for the event name
* specified as `type`.
* @param {string | symbol} type
* @returns {Function[]}
*/
listeners(type: string | symbol): any[];
/**
* Returns a copy of the array of listeners and wrappers for
* the event name specified as `type`.
* @returns {Function[]}
*/
rawListeners(type: string | symbol): any[];
/**
* Returns an array listing the events for which
* the emitter has registered listeners.
* @returns {any[]}
*/
eventNames(): (string | symbol)[];
/**
* Returns the number of listeners listening to event name
*/
listenerCount(eventName: string | symbol, listener?: Listener): number;
}
declare class EventEmitterAsyncResource extends EventEmitter {
/**
* @param {{
* name?: string,
* triggerAsyncId?: number,
* requireManualDestroy?: boolean,
* }} [options]
*/
constructor(options: any);
/**
* @param {symbol,string} event
* @param {...any} args
* @returns {boolean}
*/
emit(event: string | symbol, ...args: any[]): boolean;
/**
* @returns {void}
*/
emitDestroy(): void;
/**
* @type {number}
*/
get asyncId(): any;
/**
* @type {number}
*/
get triggerAsyncId(): any;
/**
* @type {EventEmitterReferencingAsyncResource}
*/
get asyncResource(): any;
}
export { EventEmitter };
+141
View File
@@ -0,0 +1,141 @@
import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
declare const kCapture: unique symbol;
declare const kShapeMode: unique symbol;
type Listener = (...args: any[]) => void;
declare class EventEmitter implements EventEmitter$1 {
_events: any;
_eventsCount: number;
_maxListeners: number | undefined;
[kCapture]: boolean;
[kShapeMode]: boolean;
static captureRejectionSymbol: symbol;
static errorMonitor: symbol;
static kMaxEventTargetListeners: symbol;
static kMaxEventTargetListenersWarned: symbol;
static usingDomains: boolean;
static get on(): typeof nodeEvents.on;
static get once(): typeof nodeEvents.once;
static get getEventListeners(): typeof nodeEvents.getEventListeners;
static get getMaxListeners(): typeof nodeEvents.getMaxListeners;
static get addAbortListener(): typeof nodeEvents.addAbortListener;
static get EventEmitterAsyncResource(): typeof EventEmitterAsyncResource;
static get EventEmitter(): typeof EventEmitter;
static setMaxListeners(n?: number, ...eventTargets: (EventEmitter | EventTarget)[]): void;
static listenerCount(emitter: EventEmitter$1, type: string): number | undefined;
static init(): void;
static get captureRejections(): any;
static set captureRejections(value: any);
static get defaultMaxListeners(): number;
static set defaultMaxListeners(arg: number);
constructor(opts?: any);
/**
* Increases the max listeners of the event emitter.
* @param {number} n
* @returns {EventEmitter}
*/
setMaxListeners(n: number): this;
/**
* Returns the current max listener value for the event emitter.
* @returns {number}
*/
getMaxListeners(): number;
/**
* Synchronously calls each of the listeners registered
* for the event.
* @param {...any} [args]
* @returns {boolean}
*/
emit(type: string | symbol, ...args: any[]): boolean;
/**
* Adds a listener to the event emitter.
* @returns {EventEmitter}
*/
addListener(type: string | symbol, listener: Listener): this;
on(type: string | symbol, listener: Listener): this;
/**
* Adds the `listener` function to the beginning of
* the listeners array.
*/
prependListener(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the event emitter.
*/
once(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the beginning of
* the listeners array.
*/
prependOnceListener(type: string | symbol, listener: Listener): this;
/**
* Removes the specified `listener` from the listeners array.
* @param {string | symbol} type
* @param {Function} listener
* @returns {EventEmitter}
*/
removeListener(type: string | symbol, listener: Listener): this;
off(type: string | symbol, listener: Listener): this;
/**
* Removes all listeners from the event emitter. (Only
* removes listeners for a specific event name if specified
* as `type`).
*/
removeAllListeners(type?: string | symbol): this;
/**
* Returns a copy of the array of listeners for the event name
* specified as `type`.
* @param {string | symbol} type
* @returns {Function[]}
*/
listeners(type: string | symbol): any[];
/**
* Returns a copy of the array of listeners and wrappers for
* the event name specified as `type`.
* @returns {Function[]}
*/
rawListeners(type: string | symbol): any[];
/**
* Returns an array listing the events for which
* the emitter has registered listeners.
* @returns {any[]}
*/
eventNames(): (string | symbol)[];
/**
* Returns the number of listeners listening to event name
*/
listenerCount(eventName: string | symbol, listener?: Listener): number;
}
declare class EventEmitterAsyncResource extends EventEmitter {
/**
* @param {{
* name?: string,
* triggerAsyncId?: number,
* requireManualDestroy?: boolean,
* }} [options]
*/
constructor(options: any);
/**
* @param {symbol,string} event
* @param {...any} args
* @returns {boolean}
*/
emit(event: string | symbol, ...args: any[]): boolean;
/**
* @returns {void}
*/
emitDestroy(): void;
/**
* @type {number}
*/
get asyncId(): any;
/**
* @type {number}
*/
get triggerAsyncId(): any;
/**
* @type {EventEmitterReferencingAsyncResource}
*/
get asyncResource(): any;
}
export { EventEmitter };
+141
View File
@@ -0,0 +1,141 @@
import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
declare const kCapture: unique symbol;
declare const kShapeMode: unique symbol;
type Listener = (...args: any[]) => void;
declare class EventEmitter implements EventEmitter$1 {
_events: any;
_eventsCount: number;
_maxListeners: number | undefined;
[kCapture]: boolean;
[kShapeMode]: boolean;
static captureRejectionSymbol: symbol;
static errorMonitor: symbol;
static kMaxEventTargetListeners: symbol;
static kMaxEventTargetListenersWarned: symbol;
static usingDomains: boolean;
static get on(): typeof nodeEvents.on;
static get once(): typeof nodeEvents.once;
static get getEventListeners(): typeof nodeEvents.getEventListeners;
static get getMaxListeners(): typeof nodeEvents.getMaxListeners;
static get addAbortListener(): typeof nodeEvents.addAbortListener;
static get EventEmitterAsyncResource(): typeof EventEmitterAsyncResource;
static get EventEmitter(): typeof EventEmitter;
static setMaxListeners(n?: number, ...eventTargets: (EventEmitter | EventTarget)[]): void;
static listenerCount(emitter: EventEmitter$1, type: string): number | undefined;
static init(): void;
static get captureRejections(): any;
static set captureRejections(value: any);
static get defaultMaxListeners(): number;
static set defaultMaxListeners(arg: number);
constructor(opts?: any);
/**
* Increases the max listeners of the event emitter.
* @param {number} n
* @returns {EventEmitter}
*/
setMaxListeners(n: number): this;
/**
* Returns the current max listener value for the event emitter.
* @returns {number}
*/
getMaxListeners(): number;
/**
* Synchronously calls each of the listeners registered
* for the event.
* @param {...any} [args]
* @returns {boolean}
*/
emit(type: string | symbol, ...args: any[]): boolean;
/**
* Adds a listener to the event emitter.
* @returns {EventEmitter}
*/
addListener(type: string | symbol, listener: Listener): this;
on(type: string | symbol, listener: Listener): this;
/**
* Adds the `listener` function to the beginning of
* the listeners array.
*/
prependListener(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the event emitter.
*/
once(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the beginning of
* the listeners array.
*/
prependOnceListener(type: string | symbol, listener: Listener): this;
/**
* Removes the specified `listener` from the listeners array.
* @param {string | symbol} type
* @param {Function} listener
* @returns {EventEmitter}
*/
removeListener(type: string | symbol, listener: Listener): this;
off(type: string | symbol, listener: Listener): this;
/**
* Removes all listeners from the event emitter. (Only
* removes listeners for a specific event name if specified
* as `type`).
*/
removeAllListeners(type?: string | symbol): this;
/**
* Returns a copy of the array of listeners for the event name
* specified as `type`.
* @param {string | symbol} type
* @returns {Function[]}
*/
listeners(type: string | symbol): any[];
/**
* Returns a copy of the array of listeners and wrappers for
* the event name specified as `type`.
* @returns {Function[]}
*/
rawListeners(type: string | symbol): any[];
/**
* Returns an array listing the events for which
* the emitter has registered listeners.
* @returns {any[]}
*/
eventNames(): (string | symbol)[];
/**
* Returns the number of listeners listening to event name
*/
listenerCount(eventName: string | symbol, listener?: Listener): number;
}
declare class EventEmitterAsyncResource extends EventEmitter {
/**
* @param {{
* name?: string,
* triggerAsyncId?: number,
* requireManualDestroy?: boolean,
* }} [options]
*/
constructor(options: any);
/**
* @param {symbol,string} event
* @param {...any} args
* @returns {boolean}
*/
emit(event: string | symbol, ...args: any[]): boolean;
/**
* @returns {void}
*/
emitDestroy(): void;
/**
* @type {number}
*/
get asyncId(): any;
/**
* @type {number}
*/
get triggerAsyncId(): any;
/**
* @type {EventEmitterReferencingAsyncResource}
*/
get asyncResource(): any;
}
export { EventEmitter };
+5
View File
@@ -0,0 +1,5 @@
let y=10;const Y=Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})()))),F=(e,t)=>e,_=Error,Z=Error,h=Error,w=Error,tt=Error,R=Symbol.for("nodejs.rejection"),f=Symbol.for("kCapture"),M=Symbol.for("events.errorMonitor"),g=Symbol.for("shapeMode"),b=Symbol.for("events.maxEventTargetListeners"),et=Symbol.for("kEnhanceStackBeforeInspector"),rt=Symbol.for("nodejs.watermarkData"),v=Symbol.for("kAsyncResource"),nt=Symbol.for("kFirstEventParam"),S=Symbol.for("kResistStopPropagation"),W=Symbol.for("events.maxEventTargetListenersWarned");class m{_events=void 0;_eventsCount=0;_maxListeners=y;[f]=!1;[g]=!1;static captureRejectionSymbol=R;static errorMonitor=M;static kMaxEventTargetListeners=b;static kMaxEventTargetListenersWarned=W;static usingDomains=!1;static get on(){return it}static get once(){return ot}static get getEventListeners(){return ct}static get getMaxListeners(){return ut}static get addAbortListener(){return $}static get EventEmitterAsyncResource(){return st}static get EventEmitter(){return m}static setMaxListeners(t=y,...r){if(r.length===0)y=t;else for(const n of r)if(q(n))n[b]=t,n[W]=!1;else if(typeof n.setMaxListeners=="function")n.setMaxListeners(t);else throw new h("eventTargets",["EventEmitter","EventTarget"],n)}static listenerCount(t,r){if(typeof t.listenerCount=="function")return t.listenerCount(r);m.prototype.listenerCount.call(t,r)}static init(){throw new Error("EventEmitter.init() is not implemented.")}static get captureRejections(){return this[f]}static set captureRejections(t){this[f]=t}static get defaultMaxListeners(){return y}static set defaultMaxListeners(t){y=t}constructor(t){this._events===void 0||this._events===Object.getPrototypeOf(this)._events?(this._events={__proto__:null},this._eventsCount=0,this[g]=!1):this[g]=!0,this._maxListeners=this._maxListeners||void 0,t?.captureRejections?this[f]=!!t.captureRejections:this[f]=m.prototype[f]}setMaxListeners(t){return this._maxListeners=t,this}getMaxListeners(){return j(this)}emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n&&s[M]!==void 0&&this.emit(M,...r),n=n&&s.error===void 0;else if(!n)return!1;if(n){let i;if(r.length>0&&(i=r[0]),i instanceof Error){try{const a={};Error.captureStackTrace?.(a,m.prototype.emit),Object.defineProperty(i,et,{__proto__:null,value:Function.prototype.bind(at,this,i,a),configurable:!0})}catch{}throw i}let u;try{u=F(i)}catch{u=i}const l=new Z(u);throw l.context=i,l}const o=s[t];if(o===void 0)return!1;if(typeof o=="function"){const i=o.apply(this,r);i!=null&&z(this,i,t,r)}else{const i=o.length,u=C(o);for(let l=0;l<i;++l){const a=u[l].apply(this,r);a!=null&&z(this,a,t,r)}}return!0}addListener(t,r){return B(this,t,r,!1),this}on(t,r){return this.addListener(t,r)}prependListener(t,r){return B(this,t,r,!0),this}once(t,r){return this.on(t,G(this,t,r)),this}prependOnceListener(t,r){return this.prependListener(t,G(this,t,r)),this}removeListener(t,r){const n=this._events;if(n===void 0)return this;const s=n[t];if(s===void 0)return this;if(s===r||s.listener===r)this._eventsCount-=1,this[g]?n[t]=void 0:this._eventsCount===0?this._events={__proto__:null}:(delete n[t],n.removeListener&&this.emit("removeListener",t,s.listener||r));else if(typeof s!="function"){let o=-1;for(let i=s.length-1;i>=0;i--)if(s[i]===r||s[i].listener===r){o=i;break}if(o<0)return this;o===0?s.shift():mt(s,o),s.length===1&&(n[t]=s[0]),n.removeListener!==void 0&&this.emit("removeListener",t,r)}return this}off(t,r){return this.removeListener(t,r)}removeAllListeners(t){const r=this._events;if(r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events={__proto__:null},this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events={__proto__:null}:delete r[t]),this[g]=!1,this;if(arguments.length===0){for(const s of Reflect.ownKeys(r))s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventsCount=0,this[g]=!1,this}const n=r[t];if(typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(let s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this}listeners(t){return U(this,t,!0)}rawListeners(t){return U(this,t,!1)}eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}listenerCount(t,r){const n=this._events;if(n!==void 0){const s=n[t];if(typeof s=="function")return r!=null?r===s||r===s.listener?1:0:1;if(s!==void 0){if(r!=null){let o=0;for(let i=0,u=s.length;i<u;i++)(s[i]===r||s[i].listener===r)&&o++;return o}return s.length}}return 0}}class st extends m{constructor(t){let r;typeof t=="string"?(r=t,t=void 0):r=t?.name||new.target.name,super(t),this[v]=new EventEmitterReferencingAsyncResource(this,r,t)}emit(t,...r){if(this[v]===void 0)throw new _("EventEmitterAsyncResource");const{asyncResource:n}=this;return Array.prototype.unshift(r,super.emit,this,t),Reflect.apply(n.runInAsyncScope,n,r)}emitDestroy(){if(this[v]===void 0)throw new _("EventEmitterAsyLine truncated
Emitted 'error' event${r} at:
`,s=(t.stack||"").split(`
`).slice(1);return e.stack+n+s.join(`
`)}function B(e,t,r,n){let s,o,i;if(o=e._events,o===void 0?(o=e._events={__proto__:null},e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener??r),o=e._events),i=o[t]),i===void 0)o[t]=r,++e._eventsCount;else if(typeof i=="function"?i=o[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),s=j(e),s>0&&i.length>s&&!i.warned){i.warned=!0;const u=new tt(`Possible EventEmitter memory leak detected. ${i.length} ${String(t)} listeners added to ${F(e)}. MaxListeners is ${s}. Use emitter.setMaxListeners() to increase limit`,{name:"MaxListenersExceededWarning",emitter:e,type:t,count:i.length});process.emitWarning(u)}return e}function ft(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function G(e,t,r){const n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=ft.bind(n);return s.listener=r,n.wrapFn=s,s}function U(e,t,r){const n=e._events;if(n===void 0)return[];const s=n[t];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?ht(s):C(s)}function C(e){switch(e.length){case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];case 4:return[e[0],e[1],e[2],e[3]];case 5:return[e[0],e[1],e[2],e[3],e[4]];case 6:return[e[0],e[1],e[2],e[3],e[4],e[5]]}return Array.prototype.slice.call(e)}function ht(e){const t=C(e);for(let r=0;r<t.length;++r){const n=t[r].listener;typeof n=="function"&&(t[r]=n)}return t}function P(e,t){return{value:e,done:t}}function E(e,t,r,n){if(typeof e.removeListener=="function")e.removeListener(t,r);else if(typeof e.removeEventListener=="function")e.removeEventListener(t,r,n);else throw new h("emitter","EventEmitter",e)}function O(e,t,r,n){if(typeof e.on=="function")n?.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,r,n);else throw new h("emitter","EventEmitter",e)}function vt(){const e=[];return{addEventListener(t,r,n,s){O(t,r,n,s),Array.prototype.push(e,[t,r,n,s])},removeAll(){for(;e.length>0;)Reflect.apply(E,void 0,e.pop())}}}function mt(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}export{m as EventEmitter};