smartlog-destination-devtools/.cache/5f/ee8467a01e9418bf9945fe543a8a61.json

1 line
19 KiB
JSON
Raw Normal View History

2018-11-13 00:32:39 +00:00
{"id":"node_modules/chai/lib/chai/utils/addLengthGuard.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}],"generated":{"js":"var fnLengthDesc = Object.getOwnPropertyDescriptor(function () {}, 'length');\n/*!\n * Chai - addLengthGuard utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * MIT Licensed\n */\n\n/**\n * ### .addLengthGuard(fn, assertionName, isChainable)\n *\n * Define `length` as a getter on the given uninvoked method assertion. The\n * getter acts as a guard against chaining `length` directly off of an uninvoked\n * method assertion, which is a problem because it references `function`'s\n * built-in `length` property instead of Chai's `length` assertion. When the\n * getter catches the user making this mistake, it throws an error with a\n * helpful message.\n *\n * There are two ways in which this mistake can be made. The first way is by\n * chaining the `length` assertion directly off of an uninvoked chainable\n * method. In this case, Chai suggests that the user use `lengthOf` instead. The\n * second way is by chaining the `length` assertion directly off of an uninvoked\n * non-chainable method. Non-chainable methods must be invoked prior to\n * chaining. In this case, Chai suggests that the user consult the docs for the\n * given assertion.\n *\n * If the `length` property of functions is unconfigurable, then return `fn`\n * without modification.\n *\n * Note that in ES6, the function's `length` property is configurable, so once\n * support for legacy environments is dropped, Chai's `length` property can\n * replace the built-in function's `length` property, and this length guard will\n * no longer be necessary. In the mean time, maintaining consistency across all\n * environments is the priority.\n *\n * @param {Function} fn\n * @param {String} assertionName\n * @param {Boolean} isChainable\n * @namespace Utils\n * @name addLengthGuard\n */\n\nmodule.exports = function addLengthGuard(fn, assertionName, isChainable) {\n if (!fnLengthDesc.configurable) return fn;\n Object.defineProperty(fn, 'length', {\n get: function () {\n if (isChainable) {\n throw Error('Invalid Chai property: ' + assertionName + '.length. Due' + ' to a compatibility issue, \"length\" cannot directly follow \"' + assertionName + '\". Use \"' + assertionName + '.lengthOf\" instead.');\n }\n\n throw Error('Invalid Chai property: ' + assertionName + '.length. See' + ' docs for proper usage of \"' + assertionName + '\".');\n }\n });\n return fn;\n};","map":{"mappings":[{"generated":{"line":1,"column":0},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":0}},{"name":"fnLengthDesc","generated":{"line":1,"column":4},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":4}},{"generated":{"line":1,"column":16},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":16}},{"name":"Object","generated":{"line":1,"column":19},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":19}},{"generated":{"line":1,"column":25},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":25}},{"name":"getOwnPropertyDescriptor","generated":{"line":1,"column":26},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":26}},{"generated":{"line":1,"column":50},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":19}},{"generated":{"line":1,"column":51},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":51}},{"generated":{"line":1,"column":63},"source":"node_modules/chai/lib/chai/utils/addLengthGuard.js","original":{"line":1,"column":63}},{"generated":{"l