Skip to content

@web-engine-dev/resources


@web-engine-dev/resources / buildDefaults

Function: buildDefaults() ​

buildDefaults(fields): Record<string, unknown>

Constructs a default value object from a set of field descriptors.

Array and object defaults are deep-cloned via structuredClone to prevent shared mutable state between callers.

Parameters ​

fields ​

Readonly<Record<string, ResourceFieldDescriptor>>

The field descriptor map

Returns ​

Record<string, unknown>

A new object with all fields set to their defaults

Proprietary software. All rights reserved.