isPage

See source code

Type guard to check if a record is a page.

function isPage(record?: UnknownRecord): record is TLPage;

Example

const record = store.get("page:abc123");

if (isPage(record)) {
  console.log(`Page name: ${record.name}`);
}

Parameters

NameDescription

record

The record to check

Returns

record is TLPage;

True if the record is a page, false otherwise

Prev
isDocument
Next
isPageId