Skip to content

looksLikeDocumentText

looksLikeDocumentText(text, format): boolean

Defined in: packages/core/src/parser/document-marks.ts:39

Whether JSON or TOML text reads as a map or story document: it names a type of map or scrollytelling, has a top-level pages key, or carries a $schema (in TOML, also a #:schema directive) under docs.maplibre-yaml.org/schema/.

ParameterType
textstring
format"json" | "toml"

boolean

The text is tested as given: a caller reading a file strips its byte-order mark first (core’s stripBom).