Socket
Socket
Sign inDemoInstall

p-each-series

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-each-series - npm Package Compare versions

Comparing version 2.2.0 to 3.0.0

63

index.d.ts
declare const stop: unique symbol;
declare namespace pEachSeries {
type StopSymbol = typeof stop;
}
export type StopSymbol = typeof stop;
declare const pEachSeries: {
/**
Stop iterating through items by returning `pEachSeries.stop` from the iterator function.
@example
```
import pEachSeries from 'p-each-series';
// Logs `a` and `b`.
const result = await pEachSeries(['a', 'b', 'c'], value => {
console.log(value);
if (value === 'b') {
return pEachSeries.stop;
}
});
console.log(result);
//=> ['a', 'b', 'c']
```
*/
readonly stop: StopSymbol;
/**
Iterate over promises serially.

@@ -17,3 +37,3 @@

```
import pEachSeries = require('p-each-series');
import pEachSeries from 'p-each-series';

@@ -28,6 +48,4 @@ const keywords = [

(async () => {
console.log(await pEachSeries(keywords, iterator));
//=> ['unicorn', 'rainbow', 'pony']
})();
console.log(await pEachSeries(keywords, iterator));
//=> ['unicorn', 'rainbow', 'pony']
```

@@ -37,31 +55,6 @@ */

input: Iterable<PromiseLike<ValueType> | ValueType>,
iterator: (element: ValueType, index: number) => pEachSeries.StopSymbol | unknown
iterator: (element: ValueType, index: number) => StopSymbol | unknown
): Promise<ValueType[]>;
/**
Stop iterating through items by returning `pEachSeries.stop` from the iterator function.
@example
```
const pEachSeries = require('p-each-series');
// Logs `a` and `b`.
const result = await pEachSeries(['a', 'b', 'c'], value => {
console.log(value);
if (value === 'b') {
return pEachSeries.stop;
}
});
console.log(result);
//=> ['a', 'b', 'c']
```
*/
readonly stop: pEachSeries.StopSymbol;
// TODO: Remove this for the next major release
default: typeof pEachSeries;
};
export = pEachSeries;
export default pEachSeries;

@@ -1,3 +0,1 @@

'use strict';
const pEachSeries = async (iterable, iterator) => {

@@ -20,4 +18,2 @@ let index = 0;

module.exports = pEachSeries;
// TODO: Remove this for the next major release
module.exports.default = pEachSeries;
export default pEachSeries;
{
"name": "p-each-series",
"version": "2.2.0",
"version": "3.0.0",
"description": "Iterate over promises serially",

@@ -13,4 +13,6 @@ "license": "MIT",

},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": ">=12"
},

@@ -43,8 +45,8 @@ "scripts": {

"devDependencies": {
"ava": "^1.4.1",
"delay": "^4.1.0",
"time-span": "^3.0.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"ava": "^3.15.0",
"delay": "^5.0.0",
"time-span": "^4.0.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
}
}

@@ -1,2 +0,2 @@

# p-each-series [![Build Status](https://travis-ci.com/sindresorhus/p-each-series.svg?branch=master)](https://travis-ci.com/github/sindresorhus/p-each-series)
# p-each-series

@@ -16,3 +16,3 @@ > Iterate over promises serially

```js
const pEachSeries = require('p-each-series');
import pEachSeries from 'p-each-series';

@@ -27,6 +27,4 @@ const keywords = [

(async () => {
console.log(await pEachSeries(keywords, iterator));
//=> ['unicorn', 'rainbow', 'pony']
})();
console.log(await pEachSeries(keywords, iterator));
//=> ['unicorn', 'rainbow', 'pony']
```

@@ -57,3 +55,3 @@

```js
const pEachSeries = require('p-each-series');
import pEachSeries from 'p-each-series';

@@ -60,0 +58,0 @@ // Logs `a` and `b`.

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc