(definitionJson, customizeFn)
| 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, |
no test coverage detected
searching dependent graphs…