🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

node-mock-http

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-mock-http - npm Package Compare versions

Comparing version
0.1.0
to
0.1.1
+1
-5
dist/_polyfill/events/nodeless.cjs

@@ -1,5 +0,1 @@

"use strict";let y=10;const Y=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),F=(t,e)=>t,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(e=y,...n){if(n.length===0)y=e;else for(const r of n)if(H(r))r[w]=e,r[W]=!1;else if(typeof r.setMaxListeners=="function")r.setMaxListeners(e);else throw new h("eventTargets",["EventEmitter","EventTarget"],r)}static listenerCount(e,n){if(typeof e.listenerCount=="function")return e.listenerCount(n);EventEmitter.prototype.listenerCount.call(e,n)}static init(){throw new Error("EventEmitter.init() is not implemented.")}static get captureRejections(){return this[l]}static set captureRejections(e){this[l]=e}static get defaultMaxListeners(){return y}static set defaultMaxListeners(e){y=e}constructor(e){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,e?.captureRejections?this[l]=!!e.captureRejections:this[l]=EventEmitter.prototype[l]}setMaxListeners(e){return this._maxListeners=e,this}getMaxListeners(){return S(this)}emit(e,...n){let r=e==="error";const s=this._events;if(s!==void 0)r&&s[A]!==void 0&&this.emit(A,...n),r=r&&s.error===void 0;else if(!r)return!1;if(r){let i;if(n.length>0&&(i=n[0]),i instanceof Error){try{const a={};Error.captureStackTrace?.(a,EventEmitter.prototype.emit),Object.defineProperty(i,ee,{__proto__:null,value:Function.prototype.bind(se,this,i,a),configurable:!0})}catch{}throw i}let c;try{c=F(i)}catch{c=i}const f=new J(c);throw f.context=i,f}const o=s[e];if(o===void 0)return!1;if(typeof o=="function"){const i=o.apply(this,n);i!=null&&O(this,i,e,n)}else{const i=o.length,c=C(o);for(let f=0;f<i;++f){const a=c[f].apply(this,n);a!=null&&O(this,a,e,n)}}return!0}addListener(e,n){return z(this,e,n,!1),this}on(e,n){return this.addListener(e,n)}prependListener(e,n){return z(this,e,n,!0),this}once(e,n){return this.on(e,U(this,e,n)),this}prependOnceListener(e,n){return this.prependListener(e,U(this,e,n)),this}removeListener(e,n){const r=this._events;if(r===void 0)return this;const s=r[e];if(s===void 0)return this;if(s===n||s.listener===n)this._eventsCount-=1,this[p]?r[e]=void 0:this._eventsCount===0?this._events={__proto__:null}:(delete r[e],r.removeListener&&this.emit("removeListener",e,s.listener||n));else if(typeof s!="function"){let o=-1;for(let i=s.length-1;i>=0;i--)if(s[i]===n||s[i].listener===n){o=i;break}if(o<0)return this;o===0?s.shift():ce(s,o),s.length===1&&(r[e]=s[0]),r.removeListener!==void 0&&this.emit("removeListener",e,n)}return this}off(e,n){return this.removeListener(e,n)}removeAllListeners(e){const n=this._events;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events={__proto__:null},this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events={__proto__:null}:delete n[e]),this[p]=!1,this;if(arguments.length===0){for(const s of Reflect.ownKeys(n))s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventsCount=0,this[p]=!1,this}const r=n[e];if(typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(let s=r.length-1;s>=0;s--)this.removeListener(e,r[s]);return this}listeners(e){return G(this,e,!0)}rawListeners(e){return G(this,e,!1)}eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}listenerCount(e,n){const r=this._events;if(r!==void 0){const s=r[e];if(typeof s=="function")return n!=null?n===s||n===s.listener?1:0:1;if(s!==void 0){if(n!=null){let o=0;for(let i=0,c=s.length;i<c;i++)(s[i]===n||s[i].listener===n)&&o++;return o}return s.length}}return 0}}class EventEmitterAsyncResource extends EventEmitter{constructor(e){let n;typeof e=="string"?(n=e,e=void 0):n=e?.name||new.target.name,super(e),this[E]=new EventEmitterReferencingAsyncResource(this,n,e)}emit(e,...n){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");const{asyncResource:r}=this;return Array.prototype.unshift(n,super.emit,this,e),Reflect.apply(r.runInAsyncScope,r,n)}emitDestroy(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");this.asyncResource.emitDestroy()}get asyncId(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this.asyncResource.asyncId()}get triggerAsyncId(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this.asyncResource.triggerAsyncId()}get asyncResource(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this[E]}}const on=function(t,e,n={}){const r=n.signal;if(r?.aborted)throw new b(void 0,{cause:r?.reason});const s=n.highWaterMark??n.highWatermark??Number.MAX_SAFE_INTEGER,o=n.lowWaterMark??n.lowWatermark??1,i=new $,c=new $;let f=!1,a=null,d=!1,m=0;const I=Object.setPrototypeOf({next(){if(m){const u=i.shift();return m--,f&&m<o&&(t.resume?.(),f=!1),Promise.resolve(T(u,!1))}if(a){const u=Promise.reject(a);return a=null,u}return d?v():new Promise(function(u,V){c.push({resolve:u,reject:V})})},return(){return v()},throw(u){if(!u||!(u instanceof Error))throw new h("EventEmitter.AsyncIterator","Error",u);x(u)},[Symbol.asyncIterator](){return this},[te]:{get size(){return m},get low(){return o},get high(){return s},get isPaused(){return f}}},Y),{addEventListener:_,removeAll:K}=ue();_(t,e,n[ne]?j:function(...u){return j(u)}),e!=="error"&&typeof t.on=="function"&&_(t,"error",x);const k=n?.close;if(k?.length)for(const u of k)_(t,u,v);const q=r?addAbortListener(r,Q):null;return I;function Q(){x(new b(void 0,{cause:r?.reason}))}function j(u){c.isEmpty()?(m++,!f&&m>s&&(f=!0,t.pause?.()),i.push(u)):c.shift().resolve(T(u,!1))}function x(u){c.isEmpty()?a=u:c.shift().reject(u),v()}function v(){q?.[Symbol.dispose](),K(),d=!0;const u=T(void 0,!0);for(;!c.isEmpty();)c.shift().resolve(u);return Promise.resolve(u)}},once=async function(t,e,n={}){const r=n?.signal;if(r?.aborted)throw new b(void 0,{cause:r?.reason});return new Promise((s,o)=>{const i=d=>{typeof t.removeListener=="function"&&t.removeListener(e,c),r!=null&&L(r,"abort",a),o(d)},c=(...d)=>{typeof t.removeListener=="function"&&t.removeListener("error",i),r!=null&&L(r,"abort",a),s(d)},f={__proto__:null,once:!0,[N]:!0};P(t,e,c,f),e!=="error"&&typeof t.once=="function"&&t.once("error",i);function a(){L(t,e,c),L(t,"error",i),o(new b(void 0,{cause:r?.reason}))}r!=null&&P(r,"abort",a,{__proto__:null,once:!0,[N]:!0})})},addAbortListener=function(t,e){if(t===void 0)throw new h("signal","AbortSignal",t);let n;return t.aborted?queueMicrotask(()=>e()):(t.addEventListener("abort",e,{__proto__:null,once:!0,[N]:!0}),n=()=>{t.removeEventListener("abort",e)}),{__proto__:null,[Symbol.dispose](){n?.()}}},getEventListeners=function(t,e){if(typeof t.listeners=="function")return t.listeners(e);if(H(t)){const n=t[kEvents].get(e),r=[];let s=n?.next;for(;s?.listener!==void 0;){const o=s.listener?.deref?s.listener.deref():s.listener;r.push(o),s=s.next}return r}throw new h("emitter",["EventEmitter","EventTarget"],t)},getMaxListeners=function(t){if(typeof t?.getMaxListeners=="function")return S(t);if(t?.[w])return t[w];throw new h("emitter",["EventEmitter","EventTarget"],t)},D=2048,M=D-1;class B{bottom;top;list;next;constructor(){this.bottom=0,this.top=0,this.list=new Array(D),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&M)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&M}shift(){const e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&M,e)}}class ${head;tail;constructor(){this.head=this.tail=new B}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new B),this.head.push(e)}shift(){const e=this.tail,n=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),n}}function H(t){return typeof t?.addEventListener=="function"}function O(t,e,n,r){if(t[l])try{const s=e.then;typeof s=="function"&&s.call(e,void 0,function(o){process.nextTick(re,t,o,n,r)})}catch(s){t.emit("error",s)}}function re(t,e,n,r){if(typeof t[R]=="function")t[R](e,n,...r);else{const s=t[l];try{t[l]=!1,t.emit("error",e)}finally{t[l]=s}}}function S(t){return t._maxListeners===void 0?y:t._maxListeners}function se(t,e){let n="";try{const{name:o}=this.constructor;o!=="EventEmitter"&&(n=` on ${o} instance`)}catch{}const r=`
Emitted 'error' event${n} at:
`,s=(e.stack||"").split(`
`).slice(1);return t.stack+r+s.join(`
`)}function z(t,e,n,r){let s,o,i;if(o=t._events,o===void 0?(o=t._events={__proto__:null},t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,n.listener??n),o=t._events),i=o[e]),i===void 0)o[e]=n,++t._eventsCount;else if(typeof i=="function"?i=o[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=S(t),s>0&&i.length>s&&!i.warned){i.warned=!0;const c=new Z(`Possible EventEmitter memory leak detected. ${i.length} ${String(e)} listeners added to ${F(t)}. MaxListeners is ${s}. Use emitter.setMaxListeners() to increase limit`,{name:"MaxListenersExceededWarning",emitter:t,type:e,count:i.length});process.emitWarning(c)}return t}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(t,e,n){const r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},s=ie.bind(r);return s.listener=n,r.wrapFn=s,s}function G(t,e,n){const r=t._events;if(r===void 0)return[];const s=r[e];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?oe(s):C(s)}function C(t){switch(t.length){case 2:return[t[0],t[1]];case 3:return[t[0],t[1],t[2]];case 4:return[t[0],t[1],t[2],t[3]];case 5:return[t[0],t[1],t[2],t[3],t[4]];case 6:return[t[0],t[1],t[2],t[3],t[4],t[5]]}return Array.prototype.slice(t)}function oe(t){const e=C(t);for(let n=0;n<e.length;++n){const r=e[n].listener;typeof r=="function"&&(e[n]=r)}return e}function T(t,e){return{value:t,done:e}}function L(t,e,n,r){if(typeof t.removeListener=="function")t.removeListener(e,n);else if(typeof t.removeEventListener=="function")t.removeEventListener(e,n,r);else throw new h("emitter","EventEmitter",t)}function P(t,e,n,r){if(typeof t.on=="function")r?.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,n,r);else throw new h("emitter","EventEmitter",t)}function ue(){const t=[];return{addEventListener(e,n,r,s){P(e,n,r,s),Array.prototype.push(t,[e,n,r,s])},removeAll(){for(;t.length>0;)Reflect.apply(L,void 0,t.pop())}}}function ce(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}exports.EventEmitter=EventEmitter;
"use strict";let u=10;class EventEmitter{__unenv__={};_events=Object.create(null);_maxListeners;static get defaultMaxListeners(){return u}static set defaultMaxListeners(e){if(typeof e!="number"||e<0||Number.isNaN(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}setMaxListeners(e){if(typeof e!="number"||e<0||Number.isNaN(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}getMaxListeners(){return v(this)}emit(e,...r){if(!this._events[e]||this._events[e].length===0)return!1;if(e==="error"){let n;if(r.length>0&&(n=r[0]),n instanceof Error)throw n;const s=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw s.context=n,s}for(const n of this._events[e])(n.listener||n).apply(this,r);return!0}addListener(e,r){return o(this,e,r,!1)}on(e,r){return o(this,e,r,!1)}prependListener(e,r){return o(this,e,r,!0)}once(e,r){return this.on(e,f(this,e,r))}prependOnceListener(e,r){return this.prependListener(e,f(this,e,r))}removeListener(e,r){return E(this,e,r)}off(e,r){return this.removeListener(e,r)}removeAllListeners(e){return d(this,e)}listeners(e){return l(this,e,!0)}rawListeners(e){return l(this,e,!1)}listenerCount(e){return this.rawListeners(e).length}eventNames(){return Object.keys(this._events)}}function o(t,e,r,n){c(r),t._events.newListener!==void 0&&t.emit("newListener",e,r.listener||r),t._events[e]||(t._events[e]=[]),n?t._events[e].unshift(r):t._events[e].push(r);const s=v(t);if(s>0&&t._events[e].length>s&&!t._events[e].warned){t._events[e].warned=!0;const i=new Error(`[unenv] Possible EventEmitter memory leak detected. ${t._events[e].length} ${e} listeners added. Use emitter.setMaxListeners() to increase limit`);i.name="MaxListenersExceededWarning",i.emitter=t,i.type=e,i.count=t._events[e]?.length,console.warn(i)}return t}function E(t,e,r){if(c(r),!t._events[e]||t._events[e].length===0)return t;const n=t._events[e].length;return t._events[e]=t._events[e].filter(s=>s!==r),n===t._events[e].length||(t._events.removeListener&&t.emit("removeListener",e,r.listener||r),t._events[e].length===0&&delete t._events[e]),t}function d(t,e){if(!e)return t._events=Object.create(null),t;if(!t._events[e]||t._events[e].length===0)return t;if(t._events.removeListener)for(const r of t._events[e])t.emit("removeListener",e,r.listener||r);return delete t._events[e],t}function f(t,e,r){let n=!1;const s=(...i)=>{if(!n)return t.removeListener(e,s),n=!0,i.length===0?r.call(t):r.apply(t,i)};return s.listener=r,s}function v(t){return t._maxListeners??EventEmitter.defaultMaxListeners}function l(t,e,r){let n=t._events[e]||[];return typeof n=="function"&&(n=[n]),r?n.map(s=>s.listener||s):n}function c(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}exports.EventEmitter=EventEmitter;

@@ -1,141 +0,32 @@

import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
import nodeEvents 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);
interface Listener {
(...args: any[]): void;
listener?: (...args: any[]) => void;
}
declare class EventEmitter implements nodeEvents.EventEmitter {
__unenv__: {};
_events: Record<string, Listener[] & {
warned?: boolean;
}>;
_maxListeners: undefined | number;
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;
emit(type: string, ...args: any[]): boolean;
addListener(type: string, listener: Listener): this;
on(type: string, listener: Listener): this;
prependListener(type: string, listener: Listener): this;
once(type: string, listener: Listener): this;
prependOnceListener(type: string, listener: Listener): this;
removeListener(type: string, listener: Listener): this;
off(type: string, listener: Listener): this;
removeAllListeners(type?: string): this;
listeners(type: string): ((...args: any[]) => void)[];
rawListeners(type: string): ((...args: any[]) => void)[];
listenerCount(type: string): number;
eventNames(): string[];
}
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 };

@@ -1,141 +0,32 @@

import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
import nodeEvents 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);
interface Listener {
(...args: any[]): void;
listener?: (...args: any[]) => void;
}
declare class EventEmitter implements nodeEvents.EventEmitter {
__unenv__: {};
_events: Record<string, Listener[] & {
warned?: boolean;
}>;
_maxListeners: undefined | number;
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;
emit(type: string, ...args: any[]): boolean;
addListener(type: string, listener: Listener): this;
on(type: string, listener: Listener): this;
prependListener(type: string, listener: Listener): this;
once(type: string, listener: Listener): this;
prependOnceListener(type: string, listener: Listener): this;
removeListener(type: string, listener: Listener): this;
off(type: string, listener: Listener): this;
removeAllListeners(type?: string): this;
listeners(type: string): ((...args: any[]) => void)[];
rawListeners(type: string): ((...args: any[]) => void)[];
listenerCount(type: string): number;
eventNames(): string[];
}
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 };

@@ -1,141 +0,32 @@

import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
import nodeEvents 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);
interface Listener {
(...args: any[]): void;
listener?: (...args: any[]) => void;
}
declare class EventEmitter implements nodeEvents.EventEmitter {
__unenv__: {};
_events: Record<string, Listener[] & {
warned?: boolean;
}>;
_maxListeners: undefined | number;
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;
emit(type: string, ...args: any[]): boolean;
addListener(type: string, listener: Listener): this;
on(type: string, listener: Listener): this;
prependListener(type: string, listener: Listener): this;
once(type: string, listener: Listener): this;
prependOnceListener(type: string, listener: Listener): this;
removeListener(type: string, listener: Listener): this;
off(type: string, listener: Listener): this;
removeAllListeners(type?: string): this;
listeners(type: string): ((...args: any[]) => void)[];
rawListeners(type: string): ((...args: any[]) => void)[];
listenerCount(type: string): number;
eventNames(): string[];
}
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 };

@@ -1,5 +0,1 @@

let v=10;const Y=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),F=(t,e)=>t,_=Error,Z=Error,h=Error,w=Error,ee=Error,R=Symbol.for("nodejs.rejection"),a=Symbol.for("kCapture"),M=Symbol.for("events.errorMonitor"),g=Symbol.for("shapeMode"),b=Symbol.for("events.maxEventTargetListeners"),te=Symbol.for("kEnhanceStackBeforeInspector"),ne=Symbol.for("nodejs.watermarkData"),d=Symbol.for("kAsyncResource"),re=Symbol.for("kFirstEventParam"),S=Symbol.for("kResistStopPropagation"),W=Symbol.for("events.maxEventTargetListenersWarned");class m{_events=void 0;_eventsCount=0;_maxListeners=v;[a]=!1;[g]=!1;static captureRejectionSymbol=R;static errorMonitor=M;static kMaxEventTargetListeners=b;static kMaxEventTargetListenersWarned=W;static usingDomains=!1;static get on(){return ie}static get once(){return oe}static get getEventListeners(){return ue}static get getMaxListeners(){return ce}static get addAbortListener(){return $}static get EventEmitterAsyncResource(){return se}static get EventEmitter(){return m}static setMaxListeners(e=v,...n){if(n.length===0)v=e;else for(const r of n)if(q(r))r[b]=e,r[W]=!1;else if(typeof r.setMaxListeners=="function")r.setMaxListeners(e);else throw new h("eventTargets",["EventEmitter","EventTarget"],r)}static listenerCount(e,n){if(typeof e.listenerCount=="function")return e.listenerCount(n);m.prototype.listenerCount.call(e,n)}static init(){throw new Error("EventEmitter.init() is not implemented.")}static get captureRejections(){return this[a]}static set captureRejections(e){this[a]=e}static get defaultMaxListeners(){return v}static set defaultMaxListeners(e){v=e}constructor(e){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,e?.captureRejections?this[a]=!!e.captureRejections:this[a]=m.prototype[a]}setMaxListeners(e){return this._maxListeners=e,this}getMaxListeners(){return j(this)}emit(e,...n){let r=e==="error";const s=this._events;if(s!==void 0)r&&s[M]!==void 0&&this.emit(M,...n),r=r&&s.error===void 0;else if(!r)return!1;if(r){let i;if(n.length>0&&(i=n[0]),i instanceof Error){try{const l={};Error.captureStackTrace?.(l,m.prototype.emit),Object.defineProperty(i,te,{__proto__:null,value:Function.prototype.bind(le,this,i,l),configurable:!0})}catch{}throw i}let c;try{c=F(i)}catch{c=i}const f=new Z(c);throw f.context=i,f}const o=s[e];if(o===void 0)return!1;if(typeof o=="function"){const i=o.apply(this,n);i!=null&&z(this,i,e,n)}else{const i=o.length,c=C(o);for(let f=0;f<i;++f){const l=c[f].apply(this,n);l!=null&&z(this,l,e,n)}}return!0}addListener(e,n){return B(this,e,n,!1),this}on(e,n){return this.addListener(e,n)}prependListener(e,n){return B(this,e,n,!0),this}once(e,n){return this.on(e,G(this,e,n)),this}prependOnceListener(e,n){return this.prependListener(e,G(this,e,n)),this}removeListener(e,n){const r=this._events;if(r===void 0)return this;const s=r[e];if(s===void 0)return this;if(s===n||s.listener===n)this._eventsCount-=1,this[g]?r[e]=void 0:this._eventsCount===0?this._events={__proto__:null}:(delete r[e],r.removeListener&&this.emit("removeListener",e,s.listener||n));else if(typeof s!="function"){let o=-1;for(let i=s.length-1;i>=0;i--)if(s[i]===n||s[i].listener===n){o=i;break}if(o<0)return this;o===0?s.shift():me(s,o),s.length===1&&(r[e]=s[0]),r.removeListener!==void 0&&this.emit("removeListener",e,n)}return this}off(e,n){return this.removeListener(e,n)}removeAllListeners(e){const n=this._events;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events={__proto__:null},this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events={__proto__:null}:delete n[e]),this[g]=!1,this;if(arguments.length===0){for(const s of Reflect.ownKeys(n))s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventsCount=0,this[g]=!1,this}const r=n[e];if(typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(let s=r.length-1;s>=0;s--)this.removeListener(e,r[s]);return this}listeners(e){return U(this,e,!0)}rawListeners(e){return U(this,e,!1)}eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}listenerCount(e,n){const r=this._events;if(r!==void 0){const s=r[e];if(typeof s=="function")return n!=null?n===s||n===s.listener?1:0:1;if(s!==void 0){if(n!=null){let o=0;for(let i=0,c=s.length;i<c;i++)(s[i]===n||s[i].listener===n)&&o++;return o}return s.length}}return 0}}class se extends m{constructor(e){let n;typeof e=="string"?(n=e,e=void 0):n=e?.name||new.target.name,super(e),this[d]=new EventEmitterReferencingAsyncResource(this,n,e)}emit(e,...n){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");const{asyncResource:r}=this;return Array.prototype.unshift(n,super.emit,this,e),Reflect.apply(r.runInAsyncScope,r,n)}emitDestroy(){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");this.asyncResource.emitDestroy()}get asyncId(){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");return this.asyncResource.asyncId()}get triggerAsyncId(){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");return this.asyncResource.triggerAsyncId()}get asyncResource(){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");return this[d]}}const ie=function(t,e,n={}){const r=n.signal;if(r?.aborted)throw new w(void 0,{cause:r?.reason});const s=n.highWaterMark??n.highWatermark??Number.MAX_SAFE_INTEGER,o=n.lowWaterMark??n.lowWatermark??1,i=new K,c=new K;let f=!1,l=null,p=!1,y=0;const H=Object.setPrototypeOf({next(){if(y){const u=i.shift();return y--,f&&y<o&&(t.resume?.(),f=!1),Promise.resolve(P(u,!1))}if(l){const u=Promise.reject(l);return l=null,u}return p?L():new Promise(function(u,X){c.push({resolve:u,reject:X})})},return(){return L()},throw(u){if(!u||!(u instanceof Error))throw new h("EventEmitter.AsyncIterator","Error",u);A(u)},[Symbol.asyncIterator](){return this},[ne]:{get size(){return y},get low(){return o},get high(){return s},get isPaused(){return f}}},Y),{addEventListener:x,removeAll:J}=de();x(t,e,n[re]?I:function(...u){return I(u)}),e!=="error"&&typeof t.on=="function"&&x(t,"error",A);const O=n?.close;if(O?.length)for(const u of O)x(t,u,L);const Q=r?$(r,V):null;return H;function V(){A(new w(void 0,{cause:r?.reason}))}function I(u){c.isEmpty()?(y++,!f&&y>s&&(f=!0,t.pause?.()),i.push(u)):c.shift().resolve(P(u,!1))}function A(u){c.isEmpty()?l=u:c.shift().reject(u),L()}function L(){Q?.[Symbol.dispose](),J(),p=!0;const u=P(void 0,!0);for(;!c.isEmpty();)c.shift().resolve(u);return Promise.resolve(u)}},oe=async function(t,e,n={}){const r=n?.signal;if(r?.aborted)throw new w(void 0,{cause:r?.reason});return new Promise((s,o)=>{const i=p=>{typeof t.removeListener=="function"&&t.removeListener(e,c),r!=null&&E(r,"abort",l),o(p)},c=(...p)=>{typeof t.removeListener=="function"&&t.removeListener("error",i),r!=null&&E(r,"abort",l),s(p)},f={__proto__:null,once:!0,[S]:!0};T(t,e,c,f),e!=="error"&&typeof t.once=="function"&&t.once("error",i);function l(){E(t,e,c),E(t,"error",i),o(new w(void 0,{cause:r?.reason}))}r!=null&&T(r,"abort",l,{__proto__:null,once:!0,[S]:!0})})},$=function(t,e){if(t===void 0)throw new h("signal","AbortSignal",t);let n;return t.aborted?queueMicrotask(()=>e()):(t.addEventListener("abort",e,{__proto__:null,once:!0,[S]:!0}),n=()=>{t.removeEventListener("abort",e)}),{__proto__:null,[Symbol.dispose](){n?.()}}},ue=function(t,e){if(typeof t.listeners=="function")return t.listeners(e);if(q(t)){const n=t[kEvents].get(e),r=[];let s=n?.next;for(;s?.listener!==void 0;){const o=s.listener?.deref?s.listener.deref():s.listener;r.push(o),s=s.next}return r}throw new h("emitter",["EventEmitter","EventTarget"],t)},ce=function(t){if(typeof t?.getMaxListeners=="function")return j(t);if(t?.[b])return t[b];throw new h("emitter",["EventEmitter","EventTarget"],t)},D=2048,k=D-1;class N{bottom;top;list;next;constructor(){this.bottom=0,this.top=0,this.list=new Array(D),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&k)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&k}shift(){const e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&k,e)}}class K{head;tail;constructor(){this.head=this.tail=new N}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new N),this.head.push(e)}shift(){const e=this.tail,n=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),n}}function q(t){return typeof t?.addEventListener=="function"}function z(t,e,n,r){if(t[a])try{const s=e.then;typeof s=="function"&&s.call(e,void 0,function(o){process.nextTick(fe,t,o,n,r)})}catch(s){t.emit("error",s)}}function fe(t,e,n,r){if(typeof t[R]=="function")t[R](e,n,...r);else{const s=t[a];try{t[a]=!1,t.emit("error",e)}finally{t[a]=s}}}function j(t){return t._maxListeners===void 0?v:t._maxListeners}function le(t,e){let n="";try{const{name:o}=this.constructor;o!=="EventEmitter"&&(n=` on ${o} instance`)}catch{}const r=`
Emitted 'error' event${n} at:
`,s=(e.stack||"").split(`
`).slice(1);return t.stack+r+s.join(`
`)}function B(t,e,n,r){let s,o,i;if(o=t._events,o===void 0?(o=t._events={__proto__:null},t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,n.listener??n),o=t._events),i=o[e]),i===void 0)o[e]=n,++t._eventsCount;else if(typeof i=="function"?i=o[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=j(t),s>0&&i.length>s&&!i.warned){i.warned=!0;const c=new ee(`Possible EventEmitter memory leak detected. ${i.length} ${String(e)} listeners added to ${F(t)}. MaxListeners is ${s}. Use emitter.setMaxListeners() to increase limit`,{name:"MaxListenersExceededWarning",emitter:t,type:e,count:i.length});process.emitWarning(c)}return t}function ae(){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(t,e,n){const r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},s=ae.bind(r);return s.listener=n,r.wrapFn=s,s}function U(t,e,n){const r=t._events;if(r===void 0)return[];const s=r[e];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?he(s):C(s)}function C(t){switch(t.length){case 2:return[t[0],t[1]];case 3:return[t[0],t[1],t[2]];case 4:return[t[0],t[1],t[2],t[3]];case 5:return[t[0],t[1],t[2],t[3],t[4]];case 6:return[t[0],t[1],t[2],t[3],t[4],t[5]]}return Array.prototype.slice(t)}function he(t){const e=C(t);for(let n=0;n<e.length;++n){const r=e[n].listener;typeof r=="function"&&(e[n]=r)}return e}function P(t,e){return{value:t,done:e}}function E(t,e,n,r){if(typeof t.removeListener=="function")t.removeListener(e,n);else if(typeof t.removeEventListener=="function")t.removeEventListener(e,n,r);else throw new h("emitter","EventEmitter",t)}function T(t,e,n,r){if(typeof t.on=="function")r?.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,n,r);else throw new h("emitter","EventEmitter",t)}function de(){const t=[];return{addEventListener(e,n,r,s){T(e,n,r,s),Array.prototype.push(t,[e,n,r,s])},removeAll(){for(;t.length>0;)Reflect.apply(E,void 0,t.pop())}}}function me(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}export{m as EventEmitter};
let u=10;class a{__unenv__={};_events=Object.create(null);_maxListeners;static get defaultMaxListeners(){return u}static set defaultMaxListeners(e){if(typeof e!="number"||e<0||Number.isNaN(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}setMaxListeners(e){if(typeof e!="number"||e<0||Number.isNaN(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}getMaxListeners(){return v(this)}emit(e,...r){if(!this._events[e]||this._events[e].length===0)return!1;if(e==="error"){let n;if(r.length>0&&(n=r[0]),n instanceof Error)throw n;const s=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw s.context=n,s}for(const n of this._events[e])(n.listener||n).apply(this,r);return!0}addListener(e,r){return o(this,e,r,!1)}on(e,r){return o(this,e,r,!1)}prependListener(e,r){return o(this,e,r,!0)}once(e,r){return this.on(e,l(this,e,r))}prependOnceListener(e,r){return this.prependListener(e,l(this,e,r))}removeListener(e,r){return c(this,e,r)}off(e,r){return this.removeListener(e,r)}removeAllListeners(e){return _(this,e)}listeners(e){return f(this,e,!0)}rawListeners(e){return f(this,e,!1)}listenerCount(e){return this.rawListeners(e).length}eventNames(){return Object.keys(this._events)}}function o(t,e,r,n){h(r),t._events.newListener!==void 0&&t.emit("newListener",e,r.listener||r),t._events[e]||(t._events[e]=[]),n?t._events[e].unshift(r):t._events[e].push(r);const s=v(t);if(s>0&&t._events[e].length>s&&!t._events[e].warned){t._events[e].warned=!0;const i=new Error(`[unenv] Possible EventEmitter memory leak detected. ${t._events[e].length} ${e} listeners added. Use emitter.setMaxListeners() to increase limit`);i.name="MaxListenersExceededWarning",i.emitter=t,i.type=e,i.count=t._events[e]?.length,console.warn(i)}return t}function c(t,e,r){if(h(r),!t._events[e]||t._events[e].length===0)return t;const n=t._events[e].length;return t._events[e]=t._events[e].filter(s=>s!==r),n===t._events[e].length||(t._events.removeListener&&t.emit("removeListener",e,r.listener||r),t._events[e].length===0&&delete t._events[e]),t}function _(t,e){if(!e)return t._events=Object.create(null),t;if(!t._events[e]||t._events[e].length===0)return t;if(t._events.removeListener)for(const r of t._events[e])t.emit("removeListener",e,r.listener||r);return delete t._events[e],t}function l(t,e,r){let n=!1;const s=(...i)=>{if(!n)return t.removeListener(e,s),n=!0,i.length===0?r.call(t):r.apply(t,i)};return s.listener=r,s}function v(t){return t._maxListeners??a.defaultMaxListeners}function f(t,e,r){let n=t._events[e]||[];return typeof n=="function"&&(n=[n]),r?n.map(s=>s.listener||s):n}function h(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}export{a as EventEmitter};
+1
-1

@@ -222,4 +222,4 @@ import NodeHTTP from 'node:http';

declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit): Promise<Response>;
declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit & AbstractRequest): Promise<Response>;
export { type AbstractRequest, type AbstractResponse, IncomingMessage, type NodeRequestHandler, type NodeRequestHeaders, type NodeResponseHeaders, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler };

@@ -222,4 +222,4 @@ import NodeHTTP from 'node:http';

declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit): Promise<Response>;
declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit & AbstractRequest): Promise<Response>;
export { type AbstractRequest, type AbstractResponse, IncomingMessage, type NodeRequestHandler, type NodeRequestHeaders, type NodeResponseHeaders, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler };

@@ -222,4 +222,4 @@ import NodeHTTP from 'node:http';

declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit): Promise<Response>;
declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit & AbstractRequest): Promise<Response>;
export { type AbstractRequest, type AbstractResponse, IncomingMessage, type NodeRequestHandler, type NodeRequestHeaders, type NodeResponseHeaders, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler };
{
"name": "node-mock-http",
"version": "0.1.0",
"version": "0.1.1",
"description": "",

@@ -62,3 +62,3 @@ "repository": "unjs/node-mock-http",

},
"packageManager": "pnpm@9.15.4"
"packageManager": "pnpm@10.2.0"
}

@@ -40,2 +40,3 @@ # node-mock-http

- Install dependencies using `pnpm install`
- Build project in stub mode using `pnpm build --stub`
- Run interactive tests using `pnpm dev`

@@ -42,0 +43,0 @@