MCPcopy Create free account
hub / github.com/dresende/node-orm2 / mapper

Function mapper

lib/Instance.js:756–758  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

754 if (asc.name in opts.data) {
755 var d = opts.data[asc.name];
756 var mapper = function (obj) {
757 return obj.isInstance ? obj : new asc.model(obj);
758 };
759
760 if (Array.isArray(d)) {
761 instance[asc.name] = d.map(mapper);

Callers 1

InstanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected