Skip to main content
Version: 1.0.0

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
Textends CMSType
Pextends PropertyBuilder<T, any> | StringProperty | NumberProperty | BooleanProperty | TimestampProperty | GeopointProperty | ReferenceProperty<any> | MapProperty<{ [Key: string]: any; }> | 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