assertIdType

Public Function

Assert whether an id correspond to a record type.

Example
assertIdType(myId, 'shape')
Parameters
NameDescription

id

string | undefined

The id to check.

type

RecordType<R, any>

The type of the record.

Returns
asserts id is IdOf<R>
References

UnknownRecord, RecordType, id, IdOf

Edit this page
Last edited on 15 June 2023
AllRecordsBaseRecord