Socket
Socket
Sign inDemoInstall

p-map

Package Overview
Dependencies
3
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 4.0.0

4

index.d.ts

@@ -6,2 +6,4 @@ declare namespace pMap {

Must be an integer from 1 and up or `Infinity`.
@default Infinity

@@ -25,3 +27,3 @@ */

*/
type Mapper<Element = any, NewElement = any> = (
type Mapper<Element = any, NewElement = unknown> = (
element: Element,

@@ -28,0 +30,0 @@ index: number

@@ -17,7 +17,7 @@ 'use strict';

if (!(typeof concurrency === 'number' && concurrency >= 1)) {
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`);
if (!((Number.isSafeInteger(concurrency) || concurrency === Infinity) && concurrency >= 1)) {
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
}
const ret = [];
const result = [];
const errors = [];

@@ -36,3 +36,3 @@ const iterator = iterable[Symbol.iterator]();

const nextItem = iterator.next();
const i = currentIndex;
const index = currentIndex;
currentIndex++;

@@ -47,3 +47,3 @@

} else {
resolve(ret);
resolve(result);
}

@@ -60,3 +60,3 @@ }

const element = await nextItem.value;
ret[i] = await mapper(element, i);
result[index] = await mapper(element, index);
resolvingCount--;

@@ -63,0 +63,0 @@ next();

{
"name": "p-map",
"version": "3.0.0",
"version": "4.0.0",
"description": "Map over promises concurrently",
"license": "MIT",
"repository": "sindresorhus/p-map",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},

@@ -49,5 +50,5 @@ "scripts": {

"time-span": "^3.1.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"tsd": "^0.7.4",
"xo": "^0.27.2"
}
}

@@ -7,3 +7,2 @@ # p-map [![Build Status](https://travis-ci.org/sindresorhus/p-map.svg?branch=master)](https://travis-ci.org/sindresorhus/p-map)

## Install

@@ -15,3 +14,2 @@

## Usage

@@ -66,4 +64,4 @@

Type: `number`<br>
Default: `Infinity`<br>
Type: `number` (Integer)\
Default: `Infinity`\
Minimum: `1`

@@ -75,3 +73,3 @@

Type: `boolean`<br>
Type: `boolean`\
Default: `true`

@@ -81,3 +79,8 @@

## p-map for enterprise
Available as part of the Tidelift Subscription.
The maintainers of p-map and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-p-map?utm_source=npm-p-map&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related

@@ -92,14 +95,1 @@

- [More…](https://github.com/sindresorhus/promise-fun)
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-p-map?utm_source=npm-p-map&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc