BeechCMS / @beechcms/core / toLocalizedPatch
Function: toLocalizedPatch()
toLocalizedPatch(
value,config):LocalizedPatch
Normalises any accepted write value of a localized branch into a LocalizedPatch:
- a write dictionary keeps its registered locales, in
config.localesorder; unregistered locale keys are dropped; - any other value (string, richtext doc, non-dictionary json) is the default-locale value;
null,undefinedand blank strings becomenull("clear this locale"). Idempotent: a patch passed back in yields the same patch.
Parameters
value
unknown