@xylabs/promise
Advanced tools
Comparing version 3.5.1 to 3.5.2
@@ -1,7 +0,2 @@ | ||
/** | ||
* 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 |
@@ -1,20 +0,2 @@ | ||
/** | ||
* 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 |
@@ -8,4 +8,3 @@ // src/fulfilled.ts | ||
var fulfilledValues = (previousValue, currentValue) => { | ||
if (currentValue.status === "fulfilled") | ||
previousValue.push(currentValue.value); | ||
if (currentValue.status === "fulfilled") previousValue.push(currentValue.value); | ||
return previousValue; | ||
@@ -12,0 +11,0 @@ }; |
@@ -1,7 +0,2 @@ | ||
/** | ||
* 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 |
@@ -7,7 +7,7 @@ export type TypedValue = bigint | string | number | boolean | null | TypedObject | TypedArray | Function | symbol | undefined; | ||
export type TypedArray = TypedValue[]; | ||
export declare const isTypedKey: (value: unknown) => value is string | number | symbol; | ||
export declare const isTypedKey: (value: unknown) => value is TypedKey; | ||
export declare const isTypedValue: (value: unknown) => value is TypedValue; | ||
export declare const isTypedArray: (value: unknown) => value is TypedArray; | ||
export declare const isValidTypedFieldPair: (pair: [key: unknown, value: unknown]) => pair is [key: string | number | symbol, value: TypedValue]; | ||
export declare const isValidTypedFieldPair: (pair: [key: unknown, value: unknown]) => pair is [key: TypedKey, value: TypedValue]; | ||
export declare const isTypedObject: (value: unknown) => value is TypedObject; | ||
//# sourceMappingURL=Typed.d.ts.map |
@@ -8,4 +8,3 @@ import { PromiseEx } from './PromiseEx'; | ||
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 |
@@ -1,7 +0,2 @@ | ||
/** | ||
* 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 |
@@ -1,20 +0,2 @@ | ||
/** | ||
* 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 |
@@ -8,4 +8,3 @@ // src/fulfilled.ts | ||
var fulfilledValues = (previousValue, currentValue) => { | ||
if (currentValue.status === "fulfilled") | ||
previousValue.push(currentValue.value); | ||
if (currentValue.status === "fulfilled") previousValue.push(currentValue.value); | ||
return previousValue; | ||
@@ -12,0 +11,0 @@ }; |
@@ -1,7 +0,2 @@ | ||
/** | ||
* 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 |
@@ -7,7 +7,7 @@ export type TypedValue = bigint | string | number | boolean | null | TypedObject | TypedArray | Function | symbol | undefined; | ||
export type TypedArray = TypedValue[]; | ||
export declare const isTypedKey: (value: unknown) => value is string | number | symbol; | ||
export declare const isTypedKey: (value: unknown) => value is TypedKey; | ||
export declare const isTypedValue: (value: unknown) => value is TypedValue; | ||
export declare const isTypedArray: (value: unknown) => value is TypedArray; | ||
export declare const isValidTypedFieldPair: (pair: [key: unknown, value: unknown]) => pair is [key: string | number | symbol, value: TypedValue]; | ||
export declare const isValidTypedFieldPair: (pair: [key: unknown, value: unknown]) => pair is [key: TypedKey, value: TypedValue]; | ||
export declare const isTypedObject: (value: unknown) => value is TypedObject; | ||
//# sourceMappingURL=Typed.d.ts.map |
@@ -8,4 +8,3 @@ import { PromiseEx } from './PromiseEx'; | ||
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 |
@@ -1,7 +0,2 @@ | ||
/** | ||
* 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 |
@@ -1,20 +0,2 @@ | ||
/** | ||
* 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 |
@@ -8,4 +8,3 @@ // src/fulfilled.ts | ||
var fulfilledValues = (previousValue, currentValue) => { | ||
if (currentValue.status === "fulfilled") | ||
previousValue.push(currentValue.value); | ||
if (currentValue.status === "fulfilled") previousValue.push(currentValue.value); | ||
return previousValue; | ||
@@ -12,0 +11,0 @@ }; |
@@ -1,7 +0,2 @@ | ||
/** | ||
* 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 |
@@ -7,7 +7,7 @@ export type TypedValue = bigint | string | number | boolean | null | TypedObject | TypedArray | Function | symbol | undefined; | ||
export type TypedArray = TypedValue[]; | ||
export declare const isTypedKey: (value: unknown) => value is string | number | symbol; | ||
export declare const isTypedKey: (value: unknown) => value is TypedKey; | ||
export declare const isTypedValue: (value: unknown) => value is TypedValue; | ||
export declare const isTypedArray: (value: unknown) => value is TypedArray; | ||
export declare const isValidTypedFieldPair: (pair: [key: unknown, value: unknown]) => pair is [key: string | number | symbol, value: TypedValue]; | ||
export declare const isValidTypedFieldPair: (pair: [key: unknown, value: unknown]) => pair is [key: TypedKey, value: TypedValue]; | ||
export declare const isTypedObject: (value: unknown) => value is TypedObject; | ||
//# sourceMappingURL=Typed.d.ts.map |
@@ -8,4 +8,3 @@ import { PromiseEx } from './PromiseEx'; | ||
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 |
@@ -39,5 +39,5 @@ { | ||
"devDependencies": { | ||
"@xylabs/ts-scripts-yarn3": "^3.10.4", | ||
"@xylabs/tsconfig": "^3.10.4", | ||
"typescript": "^5.4.5" | ||
"@xylabs/ts-scripts-yarn3": "^3.11.10", | ||
"@xylabs/tsconfig": "^3.11.10", | ||
"typescript": "^5.5.2" | ||
}, | ||
@@ -55,4 +55,4 @@ "engines": { | ||
"sideEffects": false, | ||
"version": "3.5.1", | ||
"version": "3.5.2", | ||
"type": "module" | ||
} |
import { TypedValue } from './Typed' | ||
export interface PromiseType { | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
then: () => unknown | ||
@@ -6,0 +5,0 @@ } |
@@ -1,3 +0,1 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
export type FieldType = 'string' | 'number' | 'object' | 'symbol' | 'symbol' | 'undefined' | 'null' | 'array' | 'function' | ||
@@ -4,0 +2,0 @@ |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155699
1094