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/.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text | string |
format | "json" | "toml" |
Returns
Section titled “Returns”boolean
Remarks
Section titled “Remarks”The text is tested as given: a caller reading a file strips its
byte-order mark first (core’s stripBom).