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

Function addInstanceExtraProperty

lib/Instance.js:537–556  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

535 });
536 };
537 var addInstanceExtraProperty = function (key) {
538 if (!instance.hasOwnProperty("extra")) {
539 instance.extra = {};
540 }
541 Object.defineProperty(instance.extra, key, {
542 get: function () {
543 return opts.data[key];
544 },
545 set: function (val) {
546 setInstanceProperty(key, val);
547
548 /*if (opts.autoSave) {
549 saveInstanceProperty(key, val);
550 }*/if (opts.extrachanges.indexOf(key) === -1) {
551 opts.extrachanges.push(key);
552 }
553 },
554 enumerable: true
555 });
556 };
557
558 var i, k;
559

Callers 1

InstanceFunction · 0.85

Calls 1

setInstancePropertyFunction · 0.85

Tested by

no test coverage detected