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 @@
export function isObject<T>(
value: T,
): value is Exclude<T, Primitive | AnyFunction> {
return typeof value === "object" && value !== null
}
type Primitive = string | number | boolean | undefined | null
type AnyFunction = (...args: any[]) => any