ts-guards
Version:
A collection of basic type guards.
13 lines (12 loc) • 547 B
TypeScript
/**
* Standard built-in objects
* See also https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
*/
export declare function isArray(x: unknown): x is Array<unknown>;
export declare function isArrayOf(x: unknown, y: (x: unknown) => boolean): x is Array<unknown>;
export declare function isObjectPropertyOf<P extends PropertyKey>(x: unknown, property: P): x is {
[K in P]: unknown;
};
export declare function areObjectPropertiesOf<P extends PropertyKey>(x: unknown, property: P[]): x is {
[K in P]: unknown;
};