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

@standardserver/shared

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@standardserver/shared - npm Package Compare versions

Comparing version
0.0.22
to
0.0.23
+14
-6
dist/index.d.mts

@@ -10,7 +10,2 @@ declare function toArray<T>(value: T): T extends readonly any[] ? T : (T extends undefined | null ? never : T[]);

}
/**
* Forwards an error to the global unhandled rejection handler via a rejected Promise.
* Useful for routing errors from sync contexts into async error pipelines.
*/
declare function emitUnhandledRejection(error: unknown): void;

@@ -78,2 +73,15 @@ /**

/**
* Creates a promise together with its associated `resolve` and `reject`
* functions.
*
* Equivalent to `Promise.withResolvers()`, but works in environments
* where that API is not yet available.
*/
declare function promiseWithResolvers<T>(): {
promise: Promise<T>;
resolve: (v: T) => void;
reject: (reason: unknown) => void;
};
interface GetOrBindOptions {

@@ -126,3 +134,3 @@ /**

export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, promiseWithResolvers, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
export type { AsyncCleanupFn, AsyncCleanupFnState, AsyncIteratorClassNextFn, GetOrBindOptions, SleepOptions };

@@ -10,7 +10,2 @@ declare function toArray<T>(value: T): T extends readonly any[] ? T : (T extends undefined | null ? never : T[]);

}
/**
* Forwards an error to the global unhandled rejection handler via a rejected Promise.
* Useful for routing errors from sync contexts into async error pipelines.
*/
declare function emitUnhandledRejection(error: unknown): void;

@@ -78,2 +73,15 @@ /**

/**
* Creates a promise together with its associated `resolve` and `reject`
* functions.
*
* Equivalent to `Promise.withResolvers()`, but works in environments
* where that API is not yet available.
*/
declare function promiseWithResolvers<T>(): {
promise: Promise<T>;
resolve: (v: T) => void;
reject: (reason: unknown) => void;
};
interface GetOrBindOptions {

@@ -126,3 +134,3 @@ /**

export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, promiseWithResolvers, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
export type { AsyncCleanupFn, AsyncCleanupFnState, AsyncIteratorClassNextFn, GetOrBindOptions, SleepOptions };

@@ -11,7 +11,2 @@ function toArray(value) {

}
function emitUnhandledRejection(error) {
Promise.reject(error).catch(() => {
throw error;
});
}

@@ -131,2 +126,11 @@ function sequential(fn) {

function promiseWithResolvers() {
const result = {};
result.promise = new Promise((resolve, reject) => {
result.resolve = resolve;
result.reject = reject;
});
return result;
}
const GET_OR_BIND_CACHE = /* @__PURE__ */ new WeakMap();

@@ -239,2 +243,2 @@ function getOrBind(target, property, { bind = true } = {}) {

export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, promiseWithResolvers, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
{
"name": "@standardserver/shared",
"type": "module",
"version": "0.0.22",
"version": "0.0.23",
"license": "MIT",

@@ -6,0 +6,0 @@ "homepage": "https://standardserver.dev",