This commit is contained in:
Lev
2021-06-16 19:39:43 -05:00
parent 2dc386e7fd
commit 51ce0e142a
2210 changed files with 263077 additions and 0 deletions

View File

@ -0,0 +1,15 @@
ISC License
Copyright (c) 2019, Andrea Giammarchi, @WebReflection
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

View File

@ -0,0 +1,26 @@
# Promise.allSettled
[![Build Status](https://travis-ci.com/ungap/promise-all-settled.svg?branch=master)](https://travis-ci.com/ungap/promise-all-settled) [![Coverage Status](https://coveralls.io/repos/github/ungap/promise-all-settled/badge.svg?branch=master)](https://coveralls.io/github/ungap/promise-all-settled?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/ungap/promise-all-settled.svg)](https://greenkeeper.io/) ![WebReflection status](https://offline.report/status/webreflection.svg)
A cross platform [Promise.allSettled](https://github.com/tc39/proposal-promise-allSettled) polyfill.
* CDN global utility via https://unpkg.com/@ungap/promise-all-settled
* ESM via `import allSettled from '@ungap/promise-all-settled'`
* CJS via `const allSettled = require('@ungap/promise-all-settled')`
### Example
```js
const allSettled = require("@ungap/promise-all-settled");
// use it via call
allSettled.call(Promise, []);
// or bind it:
const $settled = allSettled.bind(Promise);
// or put it in the Promise class
if (!Promise.allSettled)
Promise.allSettled = allSettled;
```

View File

@ -0,0 +1,19 @@
var allSettled = Promise.allSettled || function ($) {'use strict';
var self = this;
return self.all(
$.map(
function (value) {
return self.resolve(value).then(this.$, this._);
},
{
$: function (value) {
return {status: 'fulfilled', value: value};
},
_: function (reason) {
return {status: 'rejected', reason: reason};
}
}
)
);
};
module.exports = allSettled;

View File

@ -0,0 +1 @@
{"type":"commonjs"}

View File

@ -0,0 +1,19 @@
var allSettled = Promise.allSettled || function ($) {'use strict';
var self = this;
return self.all(
$.map(
function (value) {
return self.resolve(value).then(this.$, this._);
},
{
$: function (value) {
return {status: 'fulfilled', value: value};
},
_: function (reason) {
return {status: 'rejected', reason: reason};
}
}
)
);
};
export default allSettled;

View File

@ -0,0 +1,18 @@
var allSettled = Promise.allSettled || function ($) {'use strict';
var self = this;
return self.all(
$.map(
function (value) {
return self.resolve(value).then(this.$, this._);
},
{
$: function (value) {
return {status: 'fulfilled', value: value};
},
_: function (reason) {
return {status: 'rejected', reason: reason};
}
}
)
);
};

View File

@ -0,0 +1 @@
var allSettled=Promise.allSettled||function(t){"use strict";var e=this;return e.all(t.map(function(t){return e.resolve(t).then(this.$,this._)},{$:function(t){return{status:"fulfilled",value:t}},_:function(t){return{status:"rejected",reason:t}}}))};

View File

@ -0,0 +1,72 @@
{
"_from": "@ungap/promise-all-settled@1.1.2",
"_id": "@ungap/promise-all-settled@1.1.2",
"_inBundle": false,
"_integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==",
"_location": "/@ungap/promise-all-settled",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@ungap/promise-all-settled@1.1.2",
"name": "@ungap/promise-all-settled",
"escapedName": "@ungap%2fpromise-all-settled",
"scope": "@ungap",
"rawSpec": "1.1.2",
"saveSpec": null,
"fetchSpec": "1.1.2"
},
"_requiredBy": [
"/mocha"
],
"_resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz",
"_shasum": "aa58042711d6e3275dd37dc597e5d31e8c290a44",
"_spec": "@ungap/promise-all-settled@1.1.2",
"_where": "C:\\Files\\Repositories\\UoL\\CM2010 Software Design and Development\\Topic 4\\8.2.4\\node_modules\\mocha",
"author": {
"name": "Andrea Giammarchi"
},
"bugs": {
"url": "https://github.com/ungap/promise-all-settled/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A cross platform Promise.allSettled polyfill",
"devDependencies": {
"coveralls": "^3.1.0",
"nyc": "^15.0.1",
"uglify-js": "^3.9.1"
},
"exports": {
"import": "./esm/index.js",
"default": "./cjs/index.js"
},
"homepage": "https://github.com/ungap/promise-all-settled#readme",
"keywords": [
"Promise",
"allSettled",
"polyfill",
"utility",
"ungap"
],
"license": "ISC",
"main": "./cjs/index.js",
"module": "./esm/index.js",
"name": "@ungap/promise-all-settled",
"repository": {
"type": "git",
"url": "git+https://github.com/ungap/promise-all-settled.git"
},
"scripts": {
"build": "npm run cjs && npm run esm && npm run min && npm run test && npm run size",
"cjs": "cp index.js cjs/ && echo 'module.exports = allSettled;' >> cjs/index.js",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"esm": "cp index.js esm/ && echo 'export default allSettled;' >> esm/index.js",
"min": "uglifyjs index.js --support-ie8 --comments=/^!/ -c -m -o min.js",
"size": "cat index.js | wc -c && cat min.js | wc -c && gzip -c9 min.js | wc -c && cat min.js | brotli | wc -c",
"test": "nyc node test/index.js"
},
"type": "module",
"unpkg": "min.js",
"version": "1.1.2"
}