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

Function get

lib/Settings.js:79–94  ·  view source on GitHub ↗
(key, def, obj)

Source from the content-addressed store, hash-verified

77}
78
79function get(key, def, obj) {
80 var p = key.indexOf(".");
81
82 if (p === -1) {
83 if (key === '*') {
84 return obj;
85 }
86 return obj.hasOwnProperty(key) ? obj[key] : def;
87 }
88
89 if (!obj.hasOwnProperty(key.substr(0, p))) {
90 return def;
91 }
92
93 return get(key.substr(p + 1), def, obj[key.substr(0, p)]);
94}
95
96function unset(key, obj) {
97 var p = key.indexOf(".");

Callers 1

SettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected