Skip to main content

Function: buildProperty

buildProperty<T, P>(property): P extends StringProperty ? StringProperty : P extends NumberProperty ? NumberProperty : P extends BooleanProperty ? BooleanProperty : P extends TimestampProperty ? TimestampProperty : P extends GeopointProperty ? GeopointProperty : P extends ReferenceProperty ? ReferenceProperty : P extends ArrayProperty ? ArrayProperty : P extends MapProperty ? MapProperty : P extends PropertyBuilder<T, any> ? PropertyBuilder<T, any> : any

Identity function we use to defeat the type system of Typescript and preserve the property keys.

Type parameters#

NameType
TT: CMSType
PP: PropertyBuilder<T, any> | StringProperty | NumberProperty | BooleanProperty | TimestampProperty | GeopointProperty | ReferenceProperty<any> | MapProperty<Object> | ArrayProperty<CMSType[], any> = PropertyOrBuilder<T, any>

Parameters#

NameType
propertyP

Returns#

P extends StringProperty ? StringProperty : P extends NumberProperty ? NumberProperty : P extends BooleanProperty ? BooleanProperty : P extends TimestampProperty ? TimestampProperty : P extends GeopointProperty ? GeopointProperty : P extends ReferenceProperty ? ReferenceProperty : P extends ArrayProperty ? ArrayProperty : P extends MapProperty ? MapProperty : P extends PropertyBuilder<T, any> ? PropertyBuilder<T, any> : any

Defined in#

core/builders.ts:70