Skip to content

Function: createEmptyFromSchema() ​

ts
function createEmptyFromSchema(
   schemaNode, 
   ctx, 
   options?
): any;

Defined in: domain/shadow-model.ts:499

Creates an empty value for a schema node: [] for arrays, an object with its required properties for objects, 0 for numbers, false for booleans and '' otherwise.

Parameters ​

ParameterTypeDescription
schemaNodeany-
ctxSchemaContext-
options?{ includeRequired?: boolean; seedArrayItem?: boolean; }includeRequired (default true) fills required object properties; seedArrayItem (default false) puts one empty item in arrays instead of returning [].
options.includeRequired?boolean-
options.seedArrayItem?boolean-

Returns ​

any