-
Notifications
You must be signed in to change notification settings - Fork 0
JsonKit.Types
github-actions[bot] edited this page Jul 30, 2023
·
1 revision
JsonKit.Types
Ƭ TypeGuardFunction<T>: (obj: any) => obj is T
| Name | Description |
|---|---|
T |
The type to check against |
▸ (obj): obj is T
A function that checks the input object against a specific type.
Example
type Foo {
bar: number
}
function isFoo(obj: any): obj is Foo {
const _obj: Partial<Foo> | null | undefined = obj
return typeof _obj?.bar === "number"
}| Name | Type |
|---|---|
obj |
any |
obj is T