isObjectKeyIn()
isObjectKeyIn()
isObjectKeyIn()const isObjectKeyIn = <Obj = object, Payload extends object = object>(
value: any,
key: PropertyKey,
callback: ResultCallback<any, { key: typeof key } & Payload> = resultCallback,
payload?: Payload
): value is Obj =>
callback(isObject(value) ? key in value : false, value, {
...payload,
key,
} as any);Generic type variables
Obj=object
Obj=objectPayloadextendsobject=object
Payloadextendsobject=objectParameters
value: any
value: anykey: PropertyKey
key: PropertyKeycallback: ResultCallback<any, { key: typeof key } & Payload>
callback: ResultCallback<any, { key: typeof key } & Payload>payload?: Payload
payload?: PayloadReturn type
value is Obj
value is ObjReturns
Example usage
Last updated