isKey()
isKey()
const isKey = <Payload extends object>(
value: any,
callback: ResultCallback<any, Payload> = resultCallback,
payload?: Payload
): value is PropertyKey =>
callback(
isStringType(value) || isNumberType(value) || isSymbol(value),
value,
payload
);Generic type variables
Payloadextendsobject
Parameters
value: any
callback: ResultCallback<any, Payload>
payload?: Payload
Return type
value is PropertyKey
Returns
Example usage
Key of string
Key of number
Key of symbol
Last updated