make a new package for helpers
This commit is contained in:
7
packages/helpers/is-object.ts
Normal file
7
packages/helpers/is-object.ts
Normal 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
|
||||
Reference in New Issue
Block a user