0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1,10 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Promise.prototype, "finally", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

3
web/node_modules/es5-ext/promise/#/finally/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./is-implemented")() ? Promise.prototype.finally : require("./shim");

View file

@ -0,0 +1,7 @@
"use strict";
module.exports = function () {
if (typeof Promise !== "function") return false;
if (typeof Promise.prototype.finally !== "function") return false;
return true;
};

24
web/node_modules/es5-ext/promise/#/finally/shim.js generated vendored Normal file
View file

@ -0,0 +1,24 @@
"use strict";
var ensurePlainFunction = require("../../../object/ensure-plain-function")
, isThenable = require("../../../object/is-thenable")
, ensureThenable = require("../../../object/ensure-thenable");
var resolveCallback = function (callback, next) {
var callbackResult = callback();
if (!isThenable(callbackResult)) return next();
return callbackResult.then(next);
};
module.exports = function (callback) {
ensureThenable(this);
ensurePlainFunction(callback);
return this.then(
function (result) {
return resolveCallback(callback, function () { return result; });
},
function (error) {
return resolveCallback(callback, function () { throw error; });
}
);
};