Socket
Socket
Sign inDemoInstall

bluefill

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.1.2

1

index.d.ts

@@ -43,2 +43,3 @@ interface Promise<T> {

*/
return(): Promise<void>;
return<R>(value: R): Promise<R>;

@@ -45,0 +46,0 @@

25

index.js

@@ -13,7 +13,7 @@ var originalCatch = Promise.prototype.catch;

}
else if (typeof onReject === 'function') {
else if (onReject) {
predicate = errorCls;
}
else {
return originalCatch.apply(this, arguments);
return originalCatch.call(this, errorCls);
}

@@ -37,13 +37,3 @@ return originalCatch.call(this, function (err) {

map: function (iterator) {
return this.then(function (items) {
if (!Array.isArray(items)) {
throw new Error('Expected array of items to Promise.map (via ' +
("bluefill). Got: " + JSON.stringify(items)));
}
var promises = new Array(items.length);
for (var i = 0; i < promises.length; i++) {
promises[i] = iterator(items[i], i);
}
return Promise.all(promises);
});
return this.then(function (items) { return Promise.map(items, iterator); });
},

@@ -53,4 +43,11 @@ });

map: function (items, iterator) {
return Promise.resolve(items).map(iterator);
if (!Array.isArray(items)) {
throw new Error("Expected array in Promise.map, Got: " + items);
}
var promises = new Array(items.length);
for (var i = 0; i < items.length; i++) {
promises[i] = iterator(items[i], i);
}
return Promise.all(promises);
},
});
{
"name": "bluefill",
"version": "0.1.1",
"version": "0.1.2",
"description": "Bluebird-like promise polyfills with TypeScript definition support",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc