make a new package for helpers

This commit is contained in:
itsMapleLeaf
2022-07-27 22:42:35 -05:00
parent 0df45acba3
commit 831bf9ea44
35 changed files with 276 additions and 49 deletions

View File

@@ -0,0 +1,7 @@
/**
* for narrowing instance types with array.filter
*/
export const isInstanceOf =
<T>(Constructor: new (...args: any[]) => T) =>
(value: unknown): value is T =>
value instanceof Constructor