smartlog-destination-devtools/.cache/7a/215a1dce52c587890a626069531173.json

1 line
29 KiB
JSON
Raw Normal View History

2018-11-13 00:32:39 +00:00
{"id":"node_modules/chai/lib/chai/utils/addProperty.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/addProperty.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai.js"},{"name":"./flag","loc":{"line":8,"column":19},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addProperty.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/flag.js"},{"name":"./isProxyEnabled","loc":{"line":9,"column":29},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addProperty.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/isProxyEnabled.js"},{"name":"./transferFlags","loc":{"line":10,"column":28},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addProperty.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/transferFlags.js"}],"generated":{"js":"/*!\n * Chai - addProperty utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * MIT Licensed\n */\nvar chai = require('../../chai');\n\nvar flag = require('./flag');\n\nvar isProxyEnabled = require('./isProxyEnabled');\n\nvar transferFlags = require('./transferFlags');\n/**\n * ### .addProperty(ctx, name, getter)\n *\n * Adds a property to the prototype of an object.\n *\n * utils.addProperty(chai.Assertion.prototype, 'foo', function () {\n * var obj = utils.flag(this, 'object');\n * new chai.Assertion(obj).to.be.instanceof(Foo);\n * });\n *\n * Can also be accessed directly from `chai.Assertion`.\n *\n * chai.Assertion.addProperty('foo', fn);\n *\n * Then can be used as any other assertion.\n *\n * expect(myFoo).to.be.foo;\n *\n * @param {Object} ctx object to which the property is added\n * @param {String} name of property to add\n * @param {Function} getter function to be used for name\n * @namespace Utils\n * @name addProperty\n * @api public\n */\n\n\nmodule.exports = function addProperty(ctx, name, getter) {\n getter = getter === undefined ? function () {} : getter;\n Object.defineProperty(ctx, name, {\n get: function propertyGetter() {\n // Setting the `ssfi` flag to `propertyGetter` causes this function to\n // be the starting point for removing implementation frames from the\n // stack trace of a failed assertion.\n //\n // However, we only want to use this function as the starting point if\n // the `lockSsfi` flag isn't set and proxy protection is disabled.\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\n // from inside of another assertion. In the first case, the `ssfi` flag\n // has already been set by the overwriting assertion. In the second\n // case, the `ssfi` flag has already been set by the outer assertion.\n //\n // If proxy protection is enabled, then the `ssfi` flag has already been\n // set by the proxy getter.\n if (!isProxyEnabled() && !flag(this, 'lockSsfi')) {\n flag(this, 'ssfi', propertyGetter);\n }\n\n var result = getter.call(this);\n if (result !== undefined) return result;\n var newAssertion = new chai.Assertion();\n transferFlags(this, newAssertion);\n return newAssertion;\n },\n configurable: true\n });\n};","map":{"mappings":[{"generate