Skip to main content

validateLayerDefinition

Checks an untrusted value against the layer definition schema and returns every problem as a path: message line, or an empty list. Hand-written rather than a schema library, so core stays dependency-free.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { validateLayerDefinition } from "@mapcairn/core";

function validateLayerDefinition(value: unknown, options: ValidationOptions): string[];

Description​

Beyond shape, it checks what keeps layers data-driven and safe: every URL is https and every template variable has a control, a derived variable or is the engine's own; decoders and formatters are registered; derived tables cover every combination; detail origins are declared; and colour is never the only signal (categories need distinct shapes, sizes on the same field, or the card naming the field).

Parameters​

  • value (unknown)
  • options (ValidationOptions)

Returns​

string[]

See also​

Source: packages/core/src/layers/validate.ts:690