* Add a property * @param name - Property definition or name (string) * @param definitionOrType - Definition or property type
(
name: string,
definitionOrType: PropertyDefinition | PropertyType,
)
| 148 | * @param definitionOrType - Definition or property type |
| 149 | */ |
| 150 | addProperty( |
| 151 | name: string, |
| 152 | definitionOrType: PropertyDefinition | PropertyType, |
| 153 | ): this { |
| 154 | const definition = (definitionOrType as PropertyDefinition).type |
| 155 | ? (definitionOrType as PropertyDefinition) |
| 156 | : {type: definitionOrType}; |
| 157 | |
| 158 | if ( |
| 159 | definition.id === true && |
| 160 | definition.generated === true && |
| 161 | definition.type !== undefined && |
| 162 | definition.useDefaultIdType === undefined |
| 163 | ) { |
| 164 | definition.useDefaultIdType = false; |
| 165 | } |
| 166 | |
| 167 | this.properties[name] = definition; |
| 168 | return this; |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Add a setting |
no outgoing calls
no test coverage detected