isCustomRecord
Type guard to check if a record is of a specific custom type.
function isCustomRecord(typeName: string, record?: UnknownRecord): boolean;Example
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
boolean;True if the record is of the specified type
Prev
isBindingIdNext
isCustomRecordId