tooling overhaul
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* for narrowing instance types with array.filter
|
||||
*/
|
||||
/** For narrowing instance types with array.filter */
|
||||
export const isInstanceOf =
|
||||
<T>(Constructor: new (...args: any[]) => T) =>
|
||||
(value: unknown): value is T =>
|
||||
value instanceof Constructor
|
||||
<Instance, Args extends unknown[]>(
|
||||
constructor: new (...args: Args) => Instance,
|
||||
) =>
|
||||
(value: unknown): value is Instance =>
|
||||
value instanceof constructor
|
||||
|
||||
Reference in New Issue
Block a user