isCustomRecordId
Type guard to check if a string is a valid ID for a specific custom record type.
function isCustomRecordId(typeName: string, id?: string): booleanExample
const id = 'comment:abc123'
if (isCustomRecordId('comment', id)) {
// id is now typed as a comment record ID
const comment = store.get(id)
}Parameters
| Name | Description |
|---|---|
| The type name to check against |
| The string to check |
Returns
booleanTrue if the string is a valid ID for the specified record type
Prev
isCustomRecordNext
isDocument