Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@handy-common-utils/promise-utils

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@handy-common-utils/promise-utils - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

2

dist/promise-utils.d.ts

@@ -97,2 +97,3 @@ /**

* @example
* // Capture errors in the returned array
* const attributesAndPossibleErrors = await PromiseUtils.inParallel(5, topicArns, async (topicArn) => {

@@ -103,2 +104,3 @@ * const topicAttributes = (await sns.getTopicAttributes({ TopicArn: topicArn }).promise()).Attributes!;

*
* // Abort on the first error
* let results: Array<JobResult>;

@@ -105,0 +107,0 @@ * try {

@@ -131,2 +131,3 @@ "use strict";

* @example
* // Capture errors in the returned array
* const attributesAndPossibleErrors = await PromiseUtils.inParallel(5, topicArns, async (topicArn) => {

@@ -137,2 +138,3 @@ * const topicAttributes = (await sns.getTopicAttributes({ TopicArn: topicArn }).promise()).Attributes!;

*
* // Abort on the first error
* let results: Array<JobResult>;

@@ -139,0 +141,0 @@ * try {

2

package.json
{
"name": "@handy-common-utils/promise-utils",
"version": "1.4.0",
"version": "1.4.1",
"description": "Promise related utilities",

@@ -5,0 +5,0 @@ "scripts": {

@@ -63,11 +63,16 @@ # @handy-common-utils/promise-utils

// inParallel(...)
const topicArns = topics.map(topic => topic.TopicArn!);
await inParallel(5, topicArns, async topicArn => {
// Capture errors in the returned array
const attributesAndPossibleErrors = await PromiseUtils.inParallel(5, topicArns, async (topicArn) => {
const topicAttributes = (await sns.getTopicAttributes({ TopicArn: topicArn }).promise()).Attributes!;
const topicDetails = { ...topicAttributes, subscriptions: [] } as any;
if (this.shouldInclude(topicArn)) {
inventory.snsTopicsByArn.set(topicArn, topicDetails);
}
return topicAttributes;
});
// Abort on the first error
let results: Array<JobResult>;
try {
results = await PromiseUtils.inParallel(100, jobs, async (job) => processor.process(job), { abortOnError: true });
} catch (error) {
// handle the error
}
```

@@ -501,2 +506,3 @@

```ts
// Capture errors in the returned array
const attributesAndPossibleErrors = await PromiseUtils.inParallel(5, topicArns, async (topicArn) => {

@@ -507,2 +513,3 @@ const topicAttributes = (await sns.getTopicAttributes({ TopicArn: topicArn }).promise()).Attributes!;

// Abort on the first error
let results: Array<JobResult>;

@@ -509,0 +516,0 @@ try {

Sorry, the diff of this file is not supported yet

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