assertIdType
Public function
Assert whether an id correspond to a record type.
Example
assertIdType(myId, 'shape')
Signature
function assertIdType<R extends UnknownRecord>(
id: string | undefined,
type: RecordType<R, any>
): asserts id is IdOf<R>
Parameters
Name | Description |
---|---|
|
The id to check. |
|
The type of the record. |
Returns
asserts id is IdOf<R>
References
UnknownRecord, RecordType, IdOf
Source