isCustomRecord
Type guard to check if a record is of a specific custom type.
function isCustomRecord(typeName: string, record?: UnknownRecord): booleanExample
function handleRecord(record: TLRecord) {
if (isCustomRecord('comment', record)) {
// Handle comment record
console.log(`Comment: ${record.text}`)
}
}Parameters
| Name | Description |
|---|---|
| The type name to check against |
| The record to check |
Returns
booleanTrue if the record is of the specified type
Prev
isBindingIdNext
isCustomRecordId