1 line
31 KiB
JSON
1 line
31 KiB
JSON
|
{"id":"node_modules/chai/lib/chai/utils/overwriteChainableMethod.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":"../../chai","loc":{"line":7,"column":19},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai.js"},{"name":"./transferFlags","loc":{"line":8,"column":28},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/transferFlags.js"}],"generated":{"js":"/*!\n * Chai - overwriteChainableMethod utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * MIT Licensed\n */\nvar chai = require('../../chai');\n\nvar transferFlags = require('./transferFlags');\n/**\n * ### .overwriteChainableMethod(ctx, name, method, chainingBehavior)\n *\n * Overwrites an already existing chainable method\n * and provides access to the previous function or\n * property. Must return functions to be used for\n * name.\n *\n * utils.overwriteChainableMethod(chai.Assertion.prototype, 'lengthOf',\n * function (_super) {\n * }\n * , function (_super) {\n * }\n * );\n *\n * Can also be accessed directly from `chai.Assertion`.\n *\n * chai.Assertion.overwriteChainableMethod('foo', fn, fn);\n *\n * Then can be used as any other assertion.\n *\n * expect(myFoo).to.have.lengthOf(3);\n * expect(myFoo).to.have.lengthOf.above(3);\n *\n * @param {Object} ctx object whose method / property is to be overwritten\n * @param {String} name of method / property to overwrite\n * @param {Function} method function that returns a function to be used for name\n * @param {Function} chainingBehavior function that returns a function to be used for property\n * @namespace Utils\n * @name overwriteChainableMethod\n * @api public\n */\n\n\nmodule.exports = function overwriteChainableMethod(ctx, name, method, chainingBehavior) {\n var chainableBehavior = ctx.__methods[name];\n var _chainingBehavior = chainableBehavior.chainingBehavior;\n\n chainableBehavior.chainingBehavior = function overwritingChainableMethodGetter() {\n var result = chainingBehavior(_chainingBehavior).call(this);\n\n if (result !== undefined) {\n return result;\n }\n\n var newAssertion = new chai.Assertion();\n transferFlags(this, newAssertion);\n return newAssertion;\n };\n\n var _method = chainableBehavior.method;\n\n chainableBehavior.method = function overwritingChainableMethodWrapper() {\n var result = method(_method).apply(this, arguments);\n\n if (result !== undefined) {\n return result;\n }\n\n var newAssertion = new chai.Assertion();\n transferFlags(this, newAssertion);\n return newAssertion;\n };\n};","map":{"mappings":[{"generated":{"line":1,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteChainableMethod.js","original":{"line":1,"column":0}},{"generated":{"line":6,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteChainableMethod.js","original":{"line":7,"column":0}},{"name":"chai","generated":{"line":6,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteChainableMethod.js","original":{"line":7,"column":4}},{"generated":{"line":6,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteChainableMethod.js","original":{"line":7,"column":8}},{"name":"require","generated":{"line":6,"column":11},"source":"node_modules/chai/lib/chai/utils/overwriteChainableMethod.js","original":{"line":7,"column":11}},{"generated":{"line":6,"column":18},"source":"node_modules/chai/lib/chai/utils/overwr
|