Skip to content
Shapemetry

@huukhanhnguyen/model / validate/assets

validate/assets

annotationStyleErrors()

annotationStyleErrors(model): RegistryError[]

Parameters

model

ModelJSON

Returns

RegistryError[]


layerErrors()

layerErrors(model): RegistryError[]

Hard validation for the layers[] node lane.

Parameters

model

ModelJSON

Returns

RegistryError[]


materialErrors()

materialErrors(model): RegistryError[]

Hard validation for the materials[] node lane.

Parameters

model

ModelJSON

Returns

RegistryError[]


materialReferenceErrors()

materialReferenceErrors(model): RegistryError[]

Soft diagnostics: faceMaterial literal names missing from materials[]. Does NOT block Model.fromJSON — renderer falls back to default gray.

Parameters

model

ModelJSON

Returns

RegistryError[]


nodeKeyErrors()

nodeKeyErrors(model): RegistryError[]

Model-wide node-key uniqueness for the root lanes.

A key names THE VALUE AT ITS NODE and every expression in a porous lane resolves bare identifiers against ONE flat namespace built from keyedNodes() — root parameters plus root operations, nested Group children included. Two nodes claiming one key therefore have no meaning: keyedNodes() is depth-first first-wins, so the second node is silently unreachable, and BaseCollection.add renames a same-list sibling out from under the references that were written against it. The authoring path (setKey/generateKey) has always refused a taken name; a hand-written or machine-generated document could not, and loaded anyway.

Hard error (dev stage — no stored corpus to migrate). The isolated lanes (a component's own body, a texture chain, a sheet's ad hoc operations) each get a FRESH collection per resolve, so their keys are local and are not checked here.

Parameters

model

ModelJSON

Returns

RegistryError[]


patternErrors()

patternErrors(model): RegistryError[]

Hard validation for the patterns[] node lane.

Parameters

model

ModelJSON

Returns

RegistryError[]


styleErrors()

styleErrors(model): RegistryError[]

Hard validation for the styles[] node lane.

Parameters

model

ModelJSON

Returns

RegistryError[]


styleReferenceErrors()

styleReferenceErrors(model): RegistryError[]

Soft diagnostics: a viewStyle step's literal name missing from styles[]. Does NOT block Model.fromJSON — the viewport just skips applying anything special (same "renderer already falls back" reasoning as materialReferenceErrors).

Parameters

model

ModelJSON

Returns

RegistryError[]


textStyleErrors()

textStyleErrors(model): RegistryError[]

Parameters

model

ModelJSON

Returns

RegistryError[]

Last updated: 📖 2 min readEdit on GitHub