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

@xylabs/promise

Package Overview
Dependencies
Maintainers
0
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/promise - npm Package Compare versions

Comparing version 4.2.2 to 4.3.0

5

dist/neutral/fulfilled.d.ts

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

/**
* For use with Promise.allSettled to filter only successful results
* @param val
* @returns
*/
export declare const fulfilled: <T>(val: PromiseSettledResult<T>) => val is PromiseFulfilledResult<T>;
//# sourceMappingURL=fulfilled.d.ts.map

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

/**
* For use with Promise.allSettled to reduce to only successful result values
* @example <caption>Casting the initialValue provided to reduce</caption>
* const resolved = Promise.resolve('resolved')
* const rejected = Promise.reject('rejected')
* const settled = await Promise.allSettled([resolved, rejected])
* const results = settled.reduce(fulfilledValues, [] as string[])
* // results === [ 'resolved' ]
* @example <caption>Providing type parameter to reduce and initialValue type can be inferred</caption>
* const resolved = Promise.resolve('resolved')
* const rejected = Promise.reject('rejected')
* const settled = await Promise.allSettled([resolved, rejected])
* const results = settled.reduce<string[]>(fulfilledValues, [])
* // results === [ 'resolved' ]
* @param previousValue
* @param currentValue
* @returns
*/
export declare const fulfilledValues: <T>(previousValue: T[], currentValue: PromiseSettledResult<T>) => T[];
//# sourceMappingURL=fulfilledValues.d.ts.map

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

/**
* For use with Promise.allSettled to filter only rejected results
* @param val
* @returns
*/
export declare const rejected: <T>(val: PromiseSettledResult<T>) => val is PromiseRejectedResult;
//# sourceMappingURL=rejected.d.ts.map

1

dist/neutral/types.d.ts

@@ -8,3 +8,4 @@ import type { PromiseEx } from './PromiseEx.ts';

export type NullablePromisableArray<T, V = never> = PromisableArray<T | null, V>;
/** @description Used to document promises that are being used as Mutexes */
export type AsyncMutex<T> = Promise<T>;
//# sourceMappingURL=types.d.ts.map

6

package.json
{
"name": "@xylabs/promise",
"version": "4.2.2",
"version": "4.3.0",
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",

@@ -39,4 +39,4 @@ "keywords": [

"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^4.2.1",
"@xylabs/tsconfig": "^4.2.1",
"@xylabs/ts-scripts-yarn3": "^4.2.3",
"@xylabs/tsconfig": "^4.2.3",
"@xylabs/tsconfig-jest": "^4.1.0",

@@ -43,0 +43,0 @@ "typescript": "^5.6.3"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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