🐛 Update: Added support for the 'find' command in settings.local.json. Enhanced logging for various modules, including initialization and performance metrics. Improved SQLite database optimization and ensured better tracking of user interactions and system processes. 📚
This commit is contained in:
50
network-visualization/node_modules/get-value/index.js
generated
vendored
Normal file
50
network-visualization/node_modules/get-value/index.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
/*!
|
||||
* get-value <https://github.com/jonschlinkert/get-value>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
module.exports = function(obj, prop, a, b, c) {
|
||||
if (!isObject(obj) || !prop) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
prop = toString(prop);
|
||||
|
||||
// allowing for multiple properties to be passed as
|
||||
// a string or array, but much faster (3-4x) than doing
|
||||
// `[].slice.call(arguments)`
|
||||
if (a) prop += '.' + toString(a);
|
||||
if (b) prop += '.' + toString(b);
|
||||
if (c) prop += '.' + toString(c);
|
||||
|
||||
if (prop in obj) {
|
||||
return obj[prop];
|
||||
}
|
||||
|
||||
var segs = prop.split('.');
|
||||
var len = segs.length;
|
||||
var i = -1;
|
||||
|
||||
while (obj && (++i < len)) {
|
||||
var key = segs[i];
|
||||
while (key[key.length - 1] === '\\') {
|
||||
key = key.slice(0, -1) + '.' + segs[++i];
|
||||
}
|
||||
obj = obj[key];
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
function isObject(val) {
|
||||
return val !== null && (typeof val === 'object' || typeof val === 'function');
|
||||
}
|
||||
|
||||
function toString(val) {
|
||||
if (!val) return '';
|
||||
if (Array.isArray(val)) {
|
||||
return val.join('.');
|
||||
}
|
||||
return val;
|
||||
}
|
Reference in New Issue
Block a user