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

Function Settings

lib/Settings.js:35–63  ·  view source on GitHub ↗
(settings)

Source from the content-addressed store, hash-verified

33};
34
35function Settings(settings) {
36 this.settings = settings;
37
38 return {
39 set: function (key, value) {
40 set(key, value, settings);
41
42 return this;
43 },
44 get: function (key, def) {
45 var v = get(key, def, settings)
46
47 if (v instanceof Function) {
48 return v;
49 } else {
50 return _.cloneDeep(v);
51 }
52 },
53 unset: function () {
54 for (var i = 0; i < arguments.length; i++) {
55 if (typeof arguments[i] === "string") {
56 unset(arguments[i], settings);
57 }
58 }
59
60 return this;
61 }
62 };
63}
64
65function set(key, value, obj) {
66 var p = key.indexOf(".");

Callers

nothing calls this directly

Calls 3

setFunction · 0.85
getFunction · 0.85
unsetFunction · 0.85

Tested by

no test coverage detected