smartlog-destination-devtools/.cache/ae/26d88f44286f577ba2b40ecf3148a2.json

1 line
86 KiB
JSON
Raw Normal View History

2018-11-13 00:32:39 +00:00
{"id":"node_modules/chai/lib/chai/utils/proxify.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/chai/package.json","includedInParent":true,"mtime":1542058764034},{"name":"../config","loc":{"line":1,"column":21},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/proxify.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/config.js"},{"name":"./flag","loc":{"line":2,"column":19},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/proxify.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/flag.js"},{"name":"./getProperties","loc":{"line":3,"column":28},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/proxify.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/getProperties.js"},{"name":"./isProxyEnabled","loc":{"line":4,"column":29},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/proxify.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/isProxyEnabled.js"}],"generated":{"js":"var config = require('../config');\n\nvar flag = require('./flag');\n\nvar getProperties = require('./getProperties');\n\nvar isProxyEnabled = require('./isProxyEnabled');\n/*!\n * Chai - proxify utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * MIT Licensed\n */\n\n/**\n * ### .proxify(object)\n *\n * Return a proxy of given object that throws an error when a non-existent\n * property is read. By default, the root cause is assumed to be a misspelled\n * property, and thus an attempt is made to offer a reasonable suggestion from\n * the list of existing properties. However, if a nonChainableMethodName is\n * provided, then the root cause is instead a failure to invoke a non-chainable\n * method prior to reading the non-existent property.\n *\n * If proxies are unsupported or disabled via the user's Chai config, then\n * return object without modification.\n *\n * @param {Object} obj\n * @param {String} nonChainableMethodName\n * @namespace Utils\n * @name proxify\n */\n\n\nvar builtins = ['__flags', '__methods', '_obj', 'assert'];\n\nmodule.exports = function proxify(obj, nonChainableMethodName) {\n if (!isProxyEnabled()) return obj;\n return new Proxy(obj, {\n get: function proxyGetter(target, property) {\n // This check is here because we should not throw errors on Symbol properties\n // such as `Symbol.toStringTag`.\n // The values for which an error should be thrown can be configured using\n // the `config.proxyExcludedKeys` setting.\n if (typeof property === 'string' && config.proxyExcludedKeys.indexOf(property) === -1 && !Reflect.has(target, property)) {\n // Special message for invalid property access of non-chainable methods.\n if (nonChainableMethodName) {\n throw Error('Invalid Chai property: ' + nonChainableMethodName + '.' + property + '. See docs for proper usage of \"' + nonChainableMethodName + '\".');\n } // If the property is reasonably close to an existing Chai property,\n // suggest that property to the user. Only suggest properties with a\n // distance less than 4.\n\n\n var suggestion = null;\n var suggestionDistance = 4;\n getProperties(target).forEach(function (prop) {\n if (!Object.prototype.hasOwnProperty(prop) && builtins.indexOf(prop) === -1) {\n var dist = stringDistanceCapped(property, prop, suggestionDistance);\n\n if (dist < suggestionDistance) {\n suggestion = prop;\n