Skip to content

VaultMD / isFlatFrontmatter

Function: isFlatFrontmatter()

isFlatFrontmatter(fm): boolean

Defined in: src/frontmatter/validate.ts:43

Return true when every value in fm is a scalar (string, a finite number, boolean, or null) or an array of such scalars.

This is the write gate. Everything this package emits is flat, because that is what editFrontmatter can rewrite one key at a time without re-emitting the rest of the block. A note whose frontmatter nests is still read and indexed — see FrontmatterValidity's 'nested'.

Parameters

fm

Record<string, unknown>

Frontmatter map to validate.

Returns

boolean

true if all values are flat-scalar-safe; false otherwise.

Released under the MIT License.