* Get an array of names of ID properties, which are specified in * the model settings or properties with `id` attribute. * * @example * ```ts * { * settings: { * id: ['id'] * } * properties: { * id: { * type: 'string', * id: true *
()
| 279 | * ``` |
| 280 | */ |
| 281 | idProperties(): string[] { |
| 282 | if (typeof this.settings.id === 'string') { |
| 283 | return [this.settings.id]; |
| 284 | } else if (Array.isArray(this.settings.id)) { |
| 285 | return this.settings.id; |
| 286 | } |
| 287 | const idProps = Object.keys(this.properties).filter( |
| 288 | prop => this.properties[prop].id, |
| 289 | ); |
| 290 | return idProps; |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | function asJSON(value: any): any { |
no test coverage detected