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

@boostercloud/framework-common-helpers

Package Overview
Dependencies
Maintainers
15
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boostercloud/framework-common-helpers - npm Package Compare versions

Comparing version 0.26.0 to 0.26.1-pr1023.2

8

dist/index.d.ts

@@ -1,4 +0,4 @@

export * from './promises';
export * from './retrier';
export * from './instances';
export * from './run-command';
export * from './promises'
export * from './retrier'
export * from './instances'
export * from './run-command'
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./promises"), exports);
tslib_1.__exportStar(require("./retrier"), exports);
tslib_1.__exportStar(require("./instances"), exports);
tslib_1.__exportStar(require("./run-command"), exports);
(0, tslib_1.__exportStar)(require("./promises"), exports);
(0, tslib_1.__exportStar)(require("./retrier"), exports);
(0, tslib_1.__exportStar)(require("./instances"), exports);
(0, tslib_1.__exportStar)(require("./run-command"), exports);

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

import { Class } from '@boostercloud/framework-types';
export declare function createInstance<T>(instanceClass: Class<T>, rawObject: Record<string, any>): T;
export declare function createInstances<T>(instanceClass: Class<T>, rawObjects: Array<Record<string, any>>): T[];
import { Class } from '@boostercloud/framework-types'
export declare function createInstance<T>(instanceClass: Class<T>, rawObject: Record<string, any>): T
export declare function createInstances<T>(instanceClass: Class<T>, rawObjects: Array<Record<string, any>>): T[]
export declare class Promises {
/**
* Waits until all the passed promise-like values are settled, no matter if they were fulfilled or rejected.
* If some rejected were found, an array with all the rejected promises is thrown.
* If all were fulfilled, an array of PromiseFulfilledResult is returned
* @param values Array of promise-like values to be wait for
* @throws an array of PromiseRejectedResult with all the rejected promises, if any
*
* Comparison with other similar Promise methods:
* - `Promise.all`: This has an "all-or-nothing" behavior. As long as one of the promises is rejected, the result is
* rejected. More importantly, **it does not wait for al the promises to finish**, which could lead to undesired behaviors
* - `Promise.allSettled`: This method waits for all the promises to finish and then returns an array of results. Some
* of them will be fulfilled and some rejected. More importantly, **it never throws an error**, which could lead to
* unexpected consequences. For example if you do "await Promise.allSettle(...)" expecting it to throw if some of them
* failed, you won't get that.
*
* In brief, `Promises.allSettledAndFulfilled` behaves exactly the same way as `Promise.allSettle` but it throws with
* an array of the failed promises, only if there are any.
*/
static allSettledAndFulfilled<TValue>(values: Iterable<TValue>): ReturnType<PromiseConstructor['allSettled']>;
/**
* Waits until all the passed promise-like values are settled, no matter if they were fulfilled or rejected.
* If some rejected were found, an array with all the rejected promises is thrown.
* If all were fulfilled, an array of PromiseFulfilledResult is returned
* @param values Array of promise-like values to be wait for
* @throws an array of PromiseRejectedResult with all the rejected promises, if any
*
* Comparison with other similar Promise methods:
* - `Promise.all`: This has an "all-or-nothing" behavior. As long as one of the promises is rejected, the result is
* rejected. More importantly, **it does not wait for al the promises to finish**, which could lead to undesired behaviors
* - `Promise.allSettled`: This method waits for all the promises to finish and then returns an array of results. Some
* of them will be fulfilled and some rejected. More importantly, **it never throws an error**, which could lead to
* unexpected consequences. For example if you do "await Promise.allSettle(...)" expecting it to throw if some of them
* failed, you won't get that.
*
* In brief, `Promises.allSettledAndFulfilled` behaves exactly the same way as `Promise.allSettle` but it throws with
* an array of the failed promises, only if there are any.
*/
static allSettledAndFulfilled<TValue>(values: Iterable<TValue>): ReturnType<PromiseConstructor['allSettled']>
}
export declare class PromisesError extends Error {
readonly failedReasons: Array<unknown>;
constructor(rejectedResults: Array<PromiseRejectedResult>);
readonly failedReasons: Array<unknown>
constructor(rejectedResults: Array<PromiseRejectedResult>)
}

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

import { Class, Logger } from '@boostercloud/framework-types';
export declare function retryIfError<TReturn>(logger: Logger, logicToRetry: () => Promise<TReturn>, errorClassThatRetries: Class<Error>, maxRetries?: number): Promise<TReturn>;
import { Class, Logger } from '@boostercloud/framework-types'
export declare function retryIfError<TReturn>(
logger: Logger,
logicToRetry: () => Promise<TReturn>,
errorClassThatRetries: Class<Error>,
maxRetries?: number
): Promise<TReturn>

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

import { ChildProcessPromise, PromiseResult } from 'child-process-promise';
export declare function runCommand(path: string, command: string, ignoreLogs?: boolean): ChildProcessPromise<PromiseResult<string>>;
import { ChildProcessPromise, PromiseResult } from 'child-process-promise'
export declare function runCommand(
path: string,
command: string,
ignoreLogs?: boolean
): ChildProcessPromise<PromiseResult<string>>

@@ -7,3 +7,3 @@ "use strict";

var _a, _b, _c, _d;
const subprocess = child_process_promise_1.exec(command, {
const subprocess = (0, child_process_promise_1.exec)(command, {
cwd: path,

@@ -10,0 +10,0 @@ maxBuffer: 1024 * 1024 * 1024,

{
"name": "@boostercloud/framework-common-helpers",
"version": "0.26.0",
"version": "0.26.1-pr1023.2+6b59c26d",
"description": "Contains Booster common helpers used by the core and provider packages",

@@ -36,5 +36,5 @@ "keywords": [

"dependencies": {
"@boostercloud/framework-types": "^0.26.0",
"@boostercloud/framework-types": "0.26.1-pr1023.2+6b59c26d",
"child-process-promise": "^2.2.1",
"tslib": "2.3.0"
"tslib": "2.3.1"
},

@@ -48,3 +48,3 @@ "devDependencies": {

},
"gitHead": "e2b629a7a55ffef3765d5c684ed4c8ca75d80219"
"gitHead": "6b59c26d35d38c5f5836161dd3ee91bed7e707ce"
}
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