MCPcopy
hub / github.com/dresende/node-orm2 / unset

Function unset

lib/Settings.js:96–115  ·  view source on GitHub ↗
(key, obj)

Source from the content-addressed store, hash-verified

94}
95
96function unset(key, obj) {
97 var p = key.indexOf(".");
98
99 if (p === -1) {
100 if (key === '*') {
101 return 'reset';
102 } else {
103 delete obj[key];
104 }
105 return;
106 }
107
108 if (!obj.hasOwnProperty(key.substr(0, p))) {
109 return;
110 }
111
112 if (unset(key.substr(p + 1), obj[key.substr(0, p)]) === 'reset') {
113 obj[key.substr(0, p)] = {};
114 }
115}

Callers 1

SettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected