MCPcopy
hub / github.com/loopbackio/loopback-next / idProperties

Method idProperties

packages/repository/src/model.ts:281–291  ·  view source on GitHub ↗

* 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 *

()

Source from the content-addressed store, hash-verified

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
294function asJSON(value: any): any {

Callers 13

getIdPropertiesMethod · 0.80
getIdMethod · 0.80
getIdObjectMethod · 0.80
buildWhereForIdMethod · 0.80
resolveBelongsToMetadataFunction · 0.80
constructorMethod · 0.80
model.unit.tsFile · 0.80
updateByIdMethod · 0.80
replaceByIdMethod · 0.80
deleteByIdMethod · 0.80

Calls 1

keysMethod · 0.65

Tested by

no test coverage detected