Skip to content

expandGeoSugar

expandGeoSugar(node, key): SugarError | ExpandResult

Defined in: packages/core/src/model/sugar.ts:346

Expand one authored sugar node into the GeoJSON it stands for.

ParameterTypeDescription
nodeunknownthe authored sugar value (the location/locations/region/ route content, not the enclosing source). For Astro’s richer nodes, pass project(node) first (R4).
key"location" | "locations" | "region" | "route"which sugar node is, from detectSugarKey.

SugarError | ExpandResult

an ExpandResult on success, or a SugarError for structural malformation or an unknown key. Never throws; never mutates node; expanding the same node twice is deep-equal.