Skip to content

BeechCMS


BeechCMS / @beechcms/core / serializeForDb

Function: serializeForDb() ​

serializeForDb(branch, value): string | number | null

Serializes a value for writing to the DB. boolean → 0/1 | date → Unix timestamp | json/tags/richtext/repeater → JSON string Localized branches: locale dictionary ↔ compact JSON.

Parameters ​

branch ​

Branch

The branch definition.

value ​

unknown

The value to serialize.

Returns ​

string | number | null

The serialized DB value (string, number, or null).