smartlog-destination-devtools/.cache/08/5a0e291479d2b4cc16be0bc9e076e6.json

1 line
48 KiB
JSON
Raw Normal View History

2018-11-13 00:32:39 +00:00
{"id":"node_modules/pathval/index.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/package.json","includedInParent":true,"mtime":1542067438335},{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/pathval/package.json","includedInParent":true,"mtime":1542058764034}],"generated":{"js":"'use strict';\n\n/* !\n * Chai - pathval utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * @see https://github.com/logicalparadox/filtr\n * MIT Licensed\n */\n\n/**\n * ### .hasProperty(object, name)\n *\n * This allows checking whether an object has own\n * or inherited from prototype chain named property.\n *\n * Basically does the same thing as the `in`\n * operator but works properly with null/undefined values\n * and other primitives.\n *\n * var obj = {\n * arr: ['a', 'b', 'c']\n * , str: 'Hello'\n * }\n *\n * The following would be the results.\n *\n * hasProperty(obj, 'str'); // true\n * hasProperty(obj, 'constructor'); // true\n * hasProperty(obj, 'bar'); // false\n *\n * hasProperty(obj.str, 'length'); // true\n * hasProperty(obj.str, 1); // true\n * hasProperty(obj.str, 5); // false\n *\n * hasProperty(obj.arr, 'length'); // true\n * hasProperty(obj.arr, 2); // true\n * hasProperty(obj.arr, 3); // false\n *\n * @param {Object} object\n * @param {String|Symbol} name\n * @returns {Boolean} whether it exists\n * @namespace Utils\n * @name hasProperty\n * @api public\n */\n\nfunction hasProperty(obj, name) {\n if (typeof obj === 'undefined' || obj === null) {\n return false;\n }\n\n // The `in` operator does not work with primitives.\n return name in Object(obj);\n}\n\n/* !\n * ## parsePath(path)\n *\n * Helper function used to parse string object\n * paths. Use in conjunction with `internalGetPathValue`.\n *\n * var parsed = parsePath('myobject.property.subprop');\n *\n * ### Paths:\n *\n * * Can be infinitely deep and nested.\n * * Arrays are also valid using the formal `myobject.document[3].property`.\n * * Literal dots and brackets (not delimiter) must be backslash-escaped.\n *\n * @param {String} path\n * @returns {Object} parsed\n * @api private\n */\n\nfunction parsePath(path) {\n var str = path.replace(/([^\\\\])\\[/g, '$1.[');\n var parts = str.match(/(\\\\\\.|[^.]+?)+/g);\n return parts.map(function mapMatches(value) {\n var regexp = /^\\[(\\d+)\\]$/;\n var mArr = regexp.exec(value);\n var parsed = null;\n if (mArr) {\n parsed = { i: parseFloat(mArr[1]) };\n } else {\n parsed = { p: value.replace(/\\\\([.\\[\\]])/g, '$1') };\n }\n\n return parsed;\n });\n}\n\n/* !\n * ## internalGetPathValue(obj, parsed[, pathDepth])\n *\n * Helper companion function for `.parsePath` that returns\n * the value located at the parsed address.\n *\n * var value = getPathValue(obj, parsed);\n *\n * @param {Object} object to search against\n * @param {Object} parsed definition from `parsePath`.\n * @param {Number} depth (nesting level) of the property we want to retrieve\n * @returns {Object|Undefined} value\n * @api private\n */\n\nfunction internalGetPathValue(obj, parsed, pathDepth) {\n var temporaryValue = obj;\n var res = null;\n pathDepth = (typeof pathDepth === 'undefined' ? parsed.length : pathDepth);\n\n for (var i = 0; i < pathDepth; i++) {\n var part = parsed[i];\n if (temporaryValue) {\n if (typeof part.p === 'undefined') {\n temporaryValue = temporaryValue[part.i];\n } else {\n temporaryValue = temporaryValue[part.p];\n }\n\n if (i === (pathDepth - 1)) {\n res = temporaryValue;\n }\n }\n }\n\n return res;\n}\n\n/* !\n * ## internalSetPathValue(obj, value, parsed)\n *\n * Companion function for `parsePath` that sets\n * the value located at a parsed address.\n *\n * internalSetPathValue(obj, 'value', parsed);\n *\n * @param {Object} object to search and define on\n * @param {*} value to use upon set\n * @param {Object} parsed definition from `pars