MCPcopy Create free account
hub / github.com/node-config/node-config / get

Method get

lib/util.js:190–206  ·  view source on GitHub ↗
(target, property, receiver)

Source from the content-addressed store, hash-verified

188 // https://github.com/lorenwest/node-config/issues/514
189 value = new Proxy(this.makeImmutable(value), {
190 get(target, property, receiver) {
191 // Bypass proxy receiver for properties directly on the target (e.g., RegExp.prototype.source)
192 // or properties that are not functions to prevent errors related to internal object methods.
193 if (Object.hasOwn(target, property) || (property in target && typeof target[property] !== 'function')) {
194 return Reflect.get(target, property);
195 }
196
197 // Otherwise, use the proxy receiver to handle the property access
198 const ref = Reflect.get(target, property, receiver);
199
200 // Binds the method's `this` context to the target object (e.g., Date.prototype.toISOString)
201 // to ensure it behaves correctly when called on the proxy.
202 if (typeof ref === 'function') {
203 return ref.bind(target);
204 }
205 return ref;
206 },
207 set(target, name) {
208 const message = (Reflect.has(target, name) ? 'update' : 'add');
209 // Notify the user.

Callers 13

22-binary.jsFile · 0.45
11-regexp.jsFile · 0.45
23-serialize.jsFile · 0.45
21-date.jsFile · 0.45
2-config-test.jsFile · 0.45
9-raw-configs.jsFile · 0.45
config.tsFile · 0.45
defer.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected