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
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, IdOf

Source

packages/store/src/lib/RecordType.ts

AllRecordsBaseRecord