This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isObject(object) { | |
return object != null && object.constructor.name === 'Object'; | |
} | |
function isArray(object) { | |
return object != null && object.constructor.name === 'Array'; | |
} | |
/** | |
* Find all values corresponding to a matching property. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TimedPromise<T> extends Promise<T> { | |
constructor( | |
executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: unknown) => void) => void, | |
ms: number, | |
onTimeout?: () => void | |
) { | |
super((resolve, reject) => { | |
const timeout = setTimeout(() => { | |
clearTimeout(timeout); |