1 line
80 KiB
JSON
1 line
80 KiB
JSON
|
{"id":"node_modules/chai-as-promised/lib/chai-as-promised.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-as-promised/package.json","includedInParent":true,"mtime":1542058764035},{"name":"check-error","loc":{"line":3,"column":25},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai-as-promised/lib/chai-as-promised.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/check-error/index.js"}],"generated":{"js":"\"use strict\";\n/* eslint-disable no-invalid-this */\nlet checkError = require(\"check-error\");\n\nmodule.exports = (chai, utils) => {\n const Assertion = chai.Assertion;\n const assert = chai.assert;\n const proxify = utils.proxify;\n\n // If we are using a version of Chai that has checkError on it,\n // we want to use that version to be consistent. Otherwise, we use\n // what was passed to the factory.\n if (utils.checkError) {\n checkError = utils.checkError;\n }\n\n function isLegacyJQueryPromise(thenable) {\n // jQuery promises are Promises/A+-compatible since 3.0.0. jQuery 3.0.0 is also the first version\n // to define the catch method.\n return typeof thenable.catch !== \"function\" &&\n typeof thenable.always === \"function\" &&\n typeof thenable.done === \"function\" &&\n typeof thenable.fail === \"function\" &&\n typeof thenable.pipe === \"function\" &&\n typeof thenable.progress === \"function\" &&\n typeof thenable.state === \"function\";\n }\n\n function assertIsAboutPromise(assertion) {\n if (typeof assertion._obj.then !== \"function\") {\n throw new TypeError(utils.inspect(assertion._obj) + \" is not a thenable.\");\n }\n if (isLegacyJQueryPromise(assertion._obj)) {\n throw new TypeError(\"Chai as Promised is incompatible with thenables of jQuery<3.0.0, sorry! Please \" +\n \"upgrade jQuery or use another Promises/A+ compatible library (see \" +\n \"http://promisesaplus.com/).\");\n }\n }\n\n function proxifyIfSupported(assertion) {\n return proxify === undefined ? assertion : proxify(assertion);\n }\n\n function method(name, asserter) {\n utils.addMethod(Assertion.prototype, name, function () {\n assertIsAboutPromise(this);\n return asserter.apply(this, arguments);\n });\n }\n\n function property(name, asserter) {\n utils.addProperty(Assertion.prototype, name, function () {\n assertIsAboutPromise(this);\n return proxifyIfSupported(asserter.apply(this, arguments));\n });\n }\n\n function doNotify(promise, done) {\n promise.then(() => done(), done);\n }\n\n // These are for clarity and to bypass Chai refusing to allow `undefined` as actual when used with `assert`.\n function assertIfNegated(assertion, message, extra) {\n assertion.assert(true, null, message, extra.expected, extra.actual);\n }\n\n function assertIfNotNegated(assertion, message, extra) {\n assertion.assert(false, message, null, extra.expected, extra.actual);\n }\n\n function getBasePromise(assertion) {\n // We need to chain subsequent asserters on top of ones in the chain already (consider\n // `eventually.have.property(\"foo\").that.equals(\"bar\")`), only running them after the existing ones pass.\n // So the first base-promise is `assertion._obj`, but after that we use the assertions themselves, i.e.\n // previously derived promises, to chain off of.\n return typeof assertion.then === \"function\" ? assertion : assertion._obj;\n }\n\n function getReasonName(reason) {\n return reason instanceof Error ? rea
|