aveazul
Version:
Bluebird drop-in replacement built on native Promise
30 lines (29 loc) • 1.37 kB
TypeScript
export declare function isClass(fn: unknown): fn is Function;
export declare function isIdentifier(str: string): boolean;
export declare function copyOwnProperties(source: object, target: object, filter?: (key: string) => boolean): void;
/**
* Copied from bluebird/js/release/util.js
*/
export declare function isPromisified(fn: unknown): boolean;
/**
* Determines if an object is a Promise instance
* @param obj - The object to check
* @returns True if the object is a Promise instance, false otherwise
*/
export declare function isPromise(obj: unknown): obj is Promise<unknown>;
/**
* Gets all property keys from an object and its prototype chain, excluding standard
* prototypes like Object.prototype, Array.prototype, and Function.prototype
*
* @param obj - The target object to get keys from
* @param excludedProtos - An array of prototype objects to exclude keys from
* @returns Array of property keys
*/
export declare function getObjectDataKeys(obj: object | null, excludedProtos?: object[]): string[];
/**
* Triggers an uncaught exception in a safe way by scheduling it on the next event loop tick
* This is used for fatal errors that should crash the process
* @param error - The error to throw
*/
export declare function triggerUncaughtException(error: unknown): void;
export declare function toArray<T>(args: Iterable<T> | ArrayLike<T>): T[];