Skip to content

detectSugarKey

detectSugarKey(source): "location" | "locations" | "region" | "route" | SugarError | null

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

Detect the single sugar key present on a source object — the “exactly one” half of R5.

ParameterType
sourceunknown

"location" | "locations" | "region" | "route" | SugarError | null

the present SugarKey; null when none is present; a SugarError when more than one is present (mutual-exclusion violation). Presence is an own-property check, so an inherited key does not count as authored.