guardObjectKey()
guardObjectKey()
guardObjectKey()const guardObjectKey = <
Obj extends object,
Key extends keyof Obj,
Payload extends object = object
>(
value: Obj,
key: Key,
callback?: ResultCallback<Obj, { key: typeof key } & Payload>,
payload?: Payload
): value is Obj => isObjectKey(value, key, callback, payload as any);Generic type variables
Objextendsobject
ObjextendsobjectKeyextends keyofObj
Keyextends keyofObjPayloadextendsobject=object
Payloadextendsobject=objectParameters
value: Obj
value: Objkey: Key
key: Keycallback?: ResultCallback<Obj, { key: typeof key } & Payload>
callback?: ResultCallback<Obj, { key: typeof key } & Payload>payload?: Payload
payload?: PayloadReturn type
value is Obj
value is ObjReturns
Example usage
Last updated