1 line
28 KiB
JSON
1 line
28 KiB
JSON
{"id":"node_modules/chai/lib/chai/utils/addMethod.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":"./addLengthGuard","loc":{"line":7,"column":29},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addLengthGuard.js"},{"name":"../../chai","loc":{"line":8,"column":19},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai.js"},{"name":"./flag","loc":{"line":9,"column":19},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/flag.js"},{"name":"./proxify","loc":{"line":10,"column":22},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/proxify.js"},{"name":"./transferFlags","loc":{"line":11,"column":28},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/transferFlags.js"}],"generated":{"js":"/*!\n * Chai - addMethod utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * MIT Licensed\n */\nvar addLengthGuard = require('./addLengthGuard');\n\nvar chai = require('../../chai');\n\nvar flag = require('./flag');\n\nvar proxify = require('./proxify');\n\nvar transferFlags = require('./transferFlags');\n/**\n * ### .addMethod(ctx, name, method)\n *\n * Adds a method to the prototype of an object.\n *\n * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {\n * var obj = utils.flag(this, 'object');\n * new chai.Assertion(obj).to.be.equal(str);\n * });\n *\n * Can also be accessed directly from `chai.Assertion`.\n *\n * chai.Assertion.addMethod('foo', fn);\n *\n * Then can be used as any other assertion.\n *\n * expect(fooStr).to.be.foo('bar');\n *\n * @param {Object} ctx object to which the method is added\n * @param {String} name of method to add\n * @param {Function} method function to be used for name\n * @namespace Utils\n * @name addMethod\n * @api public\n */\n\n\nmodule.exports = function addMethod(ctx, name, method) {\n var methodWrapper = function () {\n // Setting the `ssfi` flag to `methodWrapper` causes this function to be the\n // starting point for removing implementation frames from the stack trace of\n // a failed assertion.\n //\n // However, we only want to use this function as the starting point if the\n // `lockSsfi` flag isn't set.\n //\n // If the `lockSsfi` flag is set, then either this assertion has been\n // overwritten by another assertion, or this assertion is being invoked from\n // inside of another assertion. In the first case, the `ssfi` flag has\n // already been set by the overwriting assertion. In the second case, the\n // `ssfi` flag has already been set by the outer assertion.\n if (!flag(this, 'lockSsfi')) {\n flag(this, 'ssfi', methodWrapper);\n }\n\n var result = method.apply(this, arguments);\n if (result !== undefined) return result;\n var newAssertion = new chai.Assertion();\n transferFlags(this, newAssertion);\n return newAssertion;\n };\n\n addLengthGuard(methodWrapper, name, false);\n ctx[name] = proxify(methodWrapper, name);\n};","map":{"mappings":[{"generated":{"line":1,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":1,"column":0}},{"generated":{"line":6,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":7,"column":0}},{"name":"addLengthGuard","generated":{"line":6,"column":4},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":7,"column":4}},{"generated":{"line":6,"column":18},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":7,"column":18}},{"name":"require","generated":{"line":6,"column":21},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":7,"column":21}},{"generated":{"line":6,"column":28},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":7,"column":28}},{"generated":{"line":6,"column":29},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":7,"column":29}},{"generated":{"line":6,"column":47},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":7,"column":28}},{"generated":{"line":6,"column":48},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":7,"column":0}},{"generated":{"line":8,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":8,"column":0}},{"name":"chai","generated":{"line":8,"column":4},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":8,"column":4}},{"generated":{"line":8,"column":8},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":8,"column":8}},{"name":"require","generated":{"line":8,"column":11},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":8,"column":11}},{"generated":{"line":8,"column":18},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":8,"column":18}},{"generated":{"line":8,"column":19},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":8,"column":19}},{"generated":{"line":8,"column":31},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":8,"column":18}},{"generated":{"line":8,"column":32},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":8,"column":0}},{"generated":{"line":10,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":9,"column":0}},{"name":"flag","generated":{"line":10,"column":4},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":9,"column":4}},{"generated":{"line":10,"column":8},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":9,"column":8}},{"name":"require","generated":{"line":10,"column":11},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":9,"column":11}},{"generated":{"line":10,"column":18},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":9,"column":18}},{"generated":{"line":10,"column":19},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":9,"column":19}},{"generated":{"line":10,"column":27},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":9,"column":18}},{"generated":{"line":10,"column":28},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":9,"column":0}},{"generated":{"line":12,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":10,"column":0}},{"name":"proxify","generated":{"line":12,"column":4},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":10,"column":4}},{"generated":{"line":12,"column":11},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":10,"column":11}},{"name":"require","generated":{"line":12,"column":14},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":10,"column":14}},{"generated":{"line":12,"column":21},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":10,"column":21}},{"generated":{"line":12,"column":22},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":10,"column":22}},{"generated":{"line":12,"column":33},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":10,"column":21}},{"generated":{"line":12,"column":34},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":10,"column":0}},{"generated":{"line":14,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":11,"column":0}},{"name":"transferFlags","generated":{"line":14,"column":4},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":11,"column":4}},{"generated":{"line":14,"column":17},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":11,"column":17}},{"name":"require","generated":{"line":14,"column":20},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":11,"column":20}},{"generated":{"line":14,"column":27},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":11,"column":27}},{"generated":{"line":14,"column":28},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":11,"column":28}},{"generated":{"line":14,"column":45},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":11,"column":27}},{"generated":{"line":14,"column":46},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":11,"column":0}},{"generated":{"line":15,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":13,"column":0}},{"name":"module","generated":{"line":42,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":0}},{"generated":{"line":42,"column":6},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":6}},{"name":"exports","generated":{"line":42,"column":7},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":7}},{"generated":{"line":42,"column":14},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":0}},{"generated":{"line":42,"column":17},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":17}},{"name":"addMethod","generated":{"line":42,"column":26},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":26}},{"generated":{"line":42,"column":35},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":17}},{"name":"ctx","generated":{"line":42,"column":36},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":36}},{"generated":{"line":42,"column":39},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":17}},{"name":"name","generated":{"line":42,"column":41},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":41}},{"generated":{"line":42,"column":45},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":17}},{"name":"method","generated":{"line":42,"column":47},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":47}},{"generated":{"line":42,"column":53},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":17}},{"generated":{"line":42,"column":55},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":55}},{"generated":{"line":43,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":40,"column":2}},{"name":"methodWrapper","generated":{"line":43,"column":6},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":40,"column":6}},{"generated":{"line":43,"column":19},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":40,"column":19}},{"generated":{"line":43,"column":22},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":40,"column":22}},{"generated":{"line":43,"column":34},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":40,"column":34}},{"generated":{"line":44,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":41,"column":4}},{"generated":{"line":45,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":42,"column":4}},{"generated":{"line":46,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":43,"column":4}},{"generated":{"line":47,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":44,"column":4}},{"generated":{"line":48,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":45,"column":4}},{"generated":{"line":49,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":46,"column":4}},{"generated":{"line":50,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":47,"column":4}},{"generated":{"line":51,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":48,"column":4}},{"generated":{"line":52,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":49,"column":4}},{"generated":{"line":53,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":50,"column":4}},{"generated":{"line":54,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":51,"column":4}},{"generated":{"line":55,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":52,"column":4}},{"generated":{"line":56,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":4}},{"generated":{"line":56,"column":8},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":8}},{"name":"flag","generated":{"line":56,"column":9},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":9}},{"generated":{"line":56,"column":13},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":13}},{"generated":{"line":56,"column":14},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":14}},{"generated":{"line":56,"column":18},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":13}},{"generated":{"line":56,"column":20},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":20}},{"generated":{"line":56,"column":30},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":13}},{"generated":{"line":56,"column":31},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":4}},{"generated":{"line":56,"column":33},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":53,"column":33}},{"name":"flag","generated":{"line":57,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":6}},{"name":"flag","generated":{"line":57,"column":6},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":6}},{"generated":{"line":57,"column":10},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":10}},{"generated":{"line":57,"column":11},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":11}},{"generated":{"line":57,"column":15},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":10}},{"generated":{"line":57,"column":17},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":17}},{"generated":{"line":57,"column":23},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":10}},{"name":"methodWrapper","generated":{"line":57,"column":25},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":25}},{"generated":{"line":57,"column":38},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":10}},{"generated":{"line":57,"column":39},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":54,"column":6}},{"generated":{"line":58,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":55,"column":5}},{"generated":{"line":60,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":4}},{"name":"result","generated":{"line":60,"column":8},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":8}},{"generated":{"line":60,"column":14},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":14}},{"name":"method","generated":{"line":60,"column":17},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":17}},{"generated":{"line":60,"column":23},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":23}},{"name":"apply","generated":{"line":60,"column":24},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":24}},{"generated":{"line":60,"column":29},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":17}},{"generated":{"line":60,"column":30},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":30}},{"generated":{"line":60,"column":34},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":17}},{"name":"arguments","generated":{"line":60,"column":36},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":36}},{"generated":{"line":60,"column":45},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":17}},{"generated":{"line":60,"column":46},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":57,"column":4}},{"generated":{"line":61,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":58,"column":4}},{"name":"result","generated":{"line":61,"column":8},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":58,"column":8}},{"generated":{"line":61,"column":14},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":58,"column":14}},{"name":"undefined","generated":{"line":61,"column":19},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":58,"column":19}},{"generated":{"line":61,"column":28},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":58,"column":4}},{"generated":{"line":61,"column":30},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":59,"column":6}},{"name":"result","generated":{"line":61,"column":37},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":59,"column":13}},{"generated":{"line":61,"column":43},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":59,"column":6}},{"generated":{"line":62,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":4}},{"name":"newAssertion","generated":{"line":62,"column":8},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":8}},{"generated":{"line":62,"column":20},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":20}},{"generated":{"line":62,"column":23},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":23}},{"name":"chai","generated":{"line":62,"column":27},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":27}},{"generated":{"line":62,"column":31},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":31}},{"name":"Assertion","generated":{"line":62,"column":32},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":32}},{"generated":{"line":62,"column":41},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":23}},{"generated":{"line":62,"column":43},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":61,"column":4}},{"name":"transferFlags","generated":{"line":63,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":62,"column":4}},{"name":"transferFlags","generated":{"line":63,"column":4},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":62,"column":4}},{"generated":{"line":63,"column":17},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":62,"column":17}},{"generated":{"line":63,"column":18},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":62,"column":18}},{"generated":{"line":63,"column":22},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":62,"column":17}},{"name":"newAssertion","generated":{"line":63,"column":24},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":62,"column":24}},{"generated":{"line":63,"column":36},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":62,"column":17}},{"generated":{"line":63,"column":37},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":62,"column":4}},{"generated":{"line":64,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":63,"column":4}},{"name":"newAssertion","generated":{"line":64,"column":11},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":63,"column":11}},{"generated":{"line":64,"column":23},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":63,"column":4}},{"generated":{"line":65,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":64,"column":3}},{"generated":{"line":65,"column":3},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":40,"column":2}},{"name":"addLengthGuard","generated":{"line":67,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":2}},{"name":"addLengthGuard","generated":{"line":67,"column":2},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":2}},{"generated":{"line":67,"column":16},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":16}},{"name":"methodWrapper","generated":{"line":67,"column":17},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":17}},{"generated":{"line":67,"column":30},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":16}},{"name":"name","generated":{"line":67,"column":32},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":32}},{"generated":{"line":67,"column":36},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":16}},{"generated":{"line":67,"column":38},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":38}},{"generated":{"line":67,"column":43},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":16}},{"generated":{"line":67,"column":44},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":66,"column":2}},{"name":"ctx","generated":{"line":68,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":2}},{"name":"ctx","generated":{"line":68,"column":2},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":2}},{"generated":{"line":68,"column":5},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":5}},{"name":"name","generated":{"line":68,"column":6},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":6}},{"generated":{"line":68,"column":10},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":5}},{"generated":{"line":68,"column":11},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":2}},{"name":"proxify","generated":{"line":68,"column":14},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":14}},{"generated":{"line":68,"column":21},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":21}},{"name":"methodWrapper","generated":{"line":68,"column":22},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":22}},{"generated":{"line":68,"column":35},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":21}},{"name":"name","generated":{"line":68,"column":37},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":37}},{"generated":{"line":68,"column":41},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":21}},{"generated":{"line":68,"column":42},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":67,"column":2}},{"generated":{"line":69,"column":0},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":68,"column":1}},{"generated":{"line":69,"column":1},"source":"node_modules/chai/lib/chai/utils/addMethod.js","original":{"line":39,"column":0}}],"sources":{"node_modules/chai/lib/chai/utils/addMethod.js":"/*!\n * Chai - addMethod utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * MIT Licensed\n */\n\nvar addLengthGuard = require('./addLengthGuard');\nvar chai = require('../../chai');\nvar flag = require('./flag');\nvar proxify = require('./proxify');\nvar transferFlags = require('./transferFlags');\n\n/**\n * ### .addMethod(ctx, name, method)\n *\n * Adds a method to the prototype of an object.\n *\n * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {\n * var obj = utils.flag(this, 'object');\n * new chai.Assertion(obj).to.be.equal(str);\n * });\n *\n * Can also be accessed directly from `chai.Assertion`.\n *\n * chai.Assertion.addMethod('foo', fn);\n *\n * Then can be used as any other assertion.\n *\n * expect(fooStr).to.be.foo('bar');\n *\n * @param {Object} ctx object to which the method is added\n * @param {String} name of method to add\n * @param {Function} method function to be used for name\n * @namespace Utils\n * @name addMethod\n * @api public\n */\n\nmodule.exports = function addMethod(ctx, name, method) {\n var methodWrapper = function () {\n // Setting the `ssfi` flag to `methodWrapper` causes this function to be the\n // starting point for removing implementation frames from the stack trace of\n // a failed assertion.\n //\n // However, we only want to use this function as the starting point if the\n // `lockSsfi` flag isn't set.\n //\n // If the `lockSsfi` flag is set, then either this assertion has been\n // overwritten by another assertion, or this assertion is being invoked from\n // inside of another assertion. In the first case, the `ssfi` flag has\n // already been set by the overwriting assertion. In the second case, the\n // `ssfi` flag has already been set by the outer assertion.\n if (!flag(this, 'lockSsfi')) {\n flag(this, 'ssfi', methodWrapper);\n }\n\n var result = method.apply(this, arguments);\n if (result !== undefined)\n return result;\n\n var newAssertion = new chai.Assertion();\n transferFlags(this, newAssertion);\n return newAssertion;\n };\n\n addLengthGuard(methodWrapper, name, false);\n ctx[name] = proxify(methodWrapper, name);\n};\n"},"lineCount":null}},"hash":"e4ed45cb0abe7d530c88a8caec41b118","cacheData":{"env":{}}} |