MCPcopy
hub / github.com/strongloop/loopback / createModel

Function createModel

lib/builtin-models.js:68–80  ·  view source on GitHub ↗
(definitionJson, customizeFn)

Source from the content-addressed store, hash-verified

66 );
67
68 function createModel(definitionJson, customizeFn) {
69 // Clone the JSON definition to allow applications
70 // to modify model settings while not affecting
71 // settings of new models created in the local registry
72 // of another app.
73 // This is needed because require() always returns the same
74 // object instance it loaded during the first call.
75 definitionJson = cloneDeepJson(definitionJson);
76
77 const Model = registry.createModel(definitionJson);
78 customizeFn(Model);
79 return Model;
80 }
81};
82
83// Because we are cloning objects created by JSON.parse,

Callers 1

builtin-models.jsFile · 0.70

Calls 1

cloneDeepJsonFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…