Comparing version 1.1.0 to 1.2.0
@@ -1,2 +0,2 @@ | ||
import type { Func } from './lang.js'; | ||
import type { ExplicitAny, Func } from './lang.js'; | ||
/** | ||
@@ -21,2 +21,10 @@ * @public | ||
*/ | ||
export declare function gowait<K extends Func<Promise<T>>, T, E = Error>(func: T, ...args: Parameters<K>): Promise<ErrorValue<T, E>>; | ||
export declare function gowait<E, T>(promised: Promise<T> | Func<Promise<T>>, ...args: ExplicitAny[]): Promise<ErrorValue<T, E>>; | ||
/** | ||
* Helper to curry a function into a "gowait" function. | ||
* Accessing the result also requires the caller to provide an error type, | ||
* otherwise never is used. | ||
* @param promised | ||
* @returns | ||
*/ | ||
export declare function wrap<T>(promised: Func<Promise<T>>): <E = never>(...args: Parameters<typeof promised>) => E extends never ? never : Promise<ErrorValue<T, E>>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.gowait = void 0; | ||
exports.wrap = exports.gowait = void 0; | ||
const nativeErrorTypes = [ | ||
@@ -25,2 +25,17 @@ EvalError, | ||
} | ||
/** | ||
* @public | ||
* Kind of like nodes ErrBacks, but with the ease (and overhead) of promises. | ||
* It will only reject promises for native errors. | ||
* Syncronous errors are caught. | ||
* @example | ||
* const [err, value] = await gowait(doWorkThatMightErrorAsync()) | ||
* if (err) { | ||
* panic(err) | ||
* } else { | ||
* success(value) | ||
* } | ||
* | ||
* @param promised | ||
*/ | ||
function gowait(promised, ...args) { | ||
@@ -44,2 +59,13 @@ if (typeof promised === 'function' && !('then' in promised)) { | ||
exports.gowait = gowait; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ293YWl0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dvd2FpdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSxNQUFNLGdCQUFnQixHQUFHO0lBQ3ZCLFNBQVM7SUFDVCxVQUFVO0lBQ1Y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0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUE7U0FDdEM7S0FDRjtJQUNELElBQUksT0FBTyxRQUFRLENBQUMsSUFBSSxLQUFLLFVBQVUsRUFBRTtRQUN2QyxPQUFPLFFBQVEsQ0FBQyxJQUFJLENBQUMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxDQUFBO0tBQzdDO0lBQ0QsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLElBQUksU0FBUyxDQUFDLEdBQUcsUUFBUSxpREFBaUQsQ0FBQyxDQUFDLENBQUE7QUFDcEcsQ0FBQztBQWhCRCx3QkFnQkMifQ== | ||
/** | ||
* Helper to curry a function into a "gowait" function. | ||
* Accessing the result also requires the caller to provide an error type, | ||
* otherwise never is used. | ||
* @param promised | ||
* @returns | ||
*/ | ||
function wrap(promised) { | ||
return (...args) => gowait(promised, ...args); | ||
} | ||
exports.wrap = wrap; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ293YWl0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dvd2FpdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSxNQUFNLGdCQUFnQixHQUFHO0lBQ3ZCLFNBQVM7SUFDVCxVQUFVO0lBQ1YsY0FBYztJQUNkLFdBQVc7SUFDWCxTQUFTO0lBQ1QsUUFBUTtDQUNULENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxPQUFPLENBQUMsS0FBSyxVQUFVLENBQUMsQ0FBQTtBQUV4QyxTQUFTLG1CQUFtQixDQUFDLEtBQWtCO0lBQzdDLEtBQUssTUFBTSxXQUFXLElBQUksZ0JBQWdCLEVBQUU7UUFDMUMsSUFBSSxLQUFLLFlBQVksV0FBVztZQUFFLE9BQU8sT0FBTyxDQUFDLE1BQU0sQ0FBQyxL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QUFHLFFBQVEsaURBQWlELENBQUMsQ0FBQyxDQUFBO0FBQ3BHLENBQUM7QUFoQkQsd0JBZ0JDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsU0FBZ0IsSUFBSSxDQUNsQixRQUEwQjtJQUkxQixPQUFPLENBQUMsR0FBRyxJQUFpQyxFQUFFLEVBQUUsQ0FBQyxNQUFNLENBQUMsUUFBUSxFQUFFLEdBQUcsSUFBSSxDQUFnQixDQUFBO0FBQzNGLENBQUM7QUFORCxvQkFNQyJ9 |
@@ -19,3 +19,3 @@ "use strict"; | ||
(0, vitest_1.it)('should return the error of the function', async () => { | ||
const func = () => Promise.reject('1234'); | ||
const func = () => new Promise((_, j) => j('1234')); | ||
const [error, result] = await (0, gowait_js_1.gowait)(func()); | ||
@@ -34,3 +34,3 @@ (0, vitest_1.expect)(result).toBeUndefined(); | ||
func.then = resolved.then.bind(resolved); | ||
const [err, value] = await (0, gowait_js_1.gowait)(func); | ||
const [err, value] = await (0, gowait_js_1.gowait)(func, 1); | ||
(0, vitest_1.expect)(value).toEqual('abcd'); | ||
@@ -51,3 +51,13 @@ (0, vitest_1.expect)(err).toBeNull(); | ||
}); | ||
(0, vitest_1.it)('should allow wrapping / currying a function', async () => { | ||
const func = (arg) => { | ||
return Promise.reject(new Error(arg.toString())); | ||
}; | ||
const wrapped = (0, gowait_js_1.wrap)(func); | ||
// an <Error> type is required | ||
const [error, result] = await wrapped(1234); | ||
(0, vitest_1.expect)(result).toBeUndefined(); | ||
(0, vitest_1.expect)(error).toEqual(new Error((1234).toString())); | ||
}); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ293YWl0LnNwZWMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZ293YWl0LnNwZWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxtQ0FBNkM7QUFDN0MsMkNBQW9DO0FBRX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ixJQUFBLGVBQU0sRUFBQyxNQUFNLENBQUMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUE7SUFDM0IsQ0FBQyxDQUFDLENBQUE7SUFFRixJQUFBLFdBQUUsRUFBQyw2Q0FBNkMsRUFBRSxLQUFLLElBQUksRUFBRTtRQUMzRCxNQUFNLElBQUksR0FBRyxDQUFDLEdBQVcsRUFBbUIsRUFBRTtZQUM1QyxPQUFPLE9BQU8sQ0FBQyxNQUFNLENBQUMsSUFBSSxLQUFLLENBQUMsR0FBRyxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUMsQ0FBQTtRQUNsRCxDQUFDLENBQUE7UUFDRCxNQUFNLE9BQU8sR0FBRyxJQUFBLGdCQUFJLEVBQUMsSUFBSSxDQUFDLENBQUE7UUFDMUIsOEJBQThCO1FBQzlCLE1BQU0sQ0FBQyxLQUFLLEVBQUUsTUFBTSxDQUFDLEdBQUcsTUFBTSxPQUFPLENBQVEsSUFBSSxDQUFDLENBQUE7UUFDbEQsSUFBQSxlQUFNLEVBQUMsTUFBTSxDQUFDLENBQUMsYUFBYSxFQUFFLENBQUE7UUFDOUIsSUFBQSxlQUFNLEVBQUMsS0FBSyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksS0FBSyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQyxDQUFBO0lBQ3JELENBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFDLENBQUEifQ== |
@@ -1,2 +0,2 @@ | ||
import type { Func } from './lang.js'; | ||
import type { ExplicitAny, Func } from './lang.js'; | ||
/** | ||
@@ -21,2 +21,10 @@ * @public | ||
*/ | ||
export declare function gowait<K extends Func<Promise<T>>, T, E = Error>(func: T, ...args: Parameters<K>): Promise<ErrorValue<T, E>>; | ||
export declare function gowait<E, T>(promised: Promise<T> | Func<Promise<T>>, ...args: ExplicitAny[]): Promise<ErrorValue<T, E>>; | ||
/** | ||
* Helper to curry a function into a "gowait" function. | ||
* Accessing the result also requires the caller to provide an error type, | ||
* otherwise never is used. | ||
* @param promised | ||
* @returns | ||
*/ | ||
export declare function wrap<T>(promised: Func<Promise<T>>): <E = never>(...args: Parameters<typeof promised>) => E extends never ? never : Promise<ErrorValue<T, E>>; |
@@ -22,2 +22,17 @@ const nativeErrorTypes = [ | ||
} | ||
/** | ||
* @public | ||
* Kind of like nodes ErrBacks, but with the ease (and overhead) of promises. | ||
* It will only reject promises for native errors. | ||
* Syncronous errors are caught. | ||
* @example | ||
* const [err, value] = await gowait(doWorkThatMightErrorAsync()) | ||
* if (err) { | ||
* panic(err) | ||
* } else { | ||
* success(value) | ||
* } | ||
* | ||
* @param promised | ||
*/ | ||
export function gowait(promised, ...args) { | ||
@@ -40,2 +55,12 @@ if (typeof promised === 'function' && !('then' in promised)) { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ293YWl0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dvd2FpdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLGdCQUFnQixHQUFHO0lBQ3ZCLFNBQVM7SUFDVCxVQUFVO0lBQ1YsY0FBYztJQUNkLFdBQVc7SUFDWCxTQUFTO0lBQ1QsUUFBUTtDQUNULENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxPQUFPLENBQUMsS0FBSyxVQUFVLENBQUMsQ0FBQTtBQUV4QyxTQUFTLG1CQUFtQixDQUFDLEtBQWtCO0lBQzdDLEtBQUssTUFBTSxXQUFXLElBQUksZ0JBQWdCLEVBQUU7UUFDMUMsSUFBSSxLQUFLLFlBQVksV0FBVztZQUFFLE9BQU8sT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQTtLQUMvRDtBQUNILENBQUM7QUFFRCxTQUFTLFV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. | ||
* Accessing the result also requires the caller to provide an error type, | ||
* otherwise never is used. | ||
* @param promised | ||
* @returns | ||
*/ | ||
export function wrap(promised) { | ||
return (...args) => gowait(promised, ...args); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ293YWl0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dvd2FpdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLGdCQUFnQixHQUFHO0lBQ3ZCLFNBQVM7SUFDVCxVQUFVO0lBQ1YsY0FBYztJQUNkLFdBQVc7SUFDWCxTQUFTO0lBQ1QsUUFBUTtDQUNULENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxPQUFPLENBQUMsS0FBSyxVQUFVLENBQUMsQ0FBQTtBQUV4QyxTQUFTLG1CQUFtQixDQUFDLEtBQWtCO0lBQzdDLEtBQUssTUFBTSxXQUFXLElBQUksZ0JBQWdCLEVBQUU7UUFDMUMsSUFBSSxLQUFLLFlBQVksV0FBVztZQUFFLE9BQU8sT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQTtLQUMvRDtBQUNILENBQUM7QUFFRCxTQUFTLFVBQVUsQ0FBSSxHQUFNO0lBQzNCLE9BQU8sQ0FBQyxJQUFJLEVBQUUsR0FBRyxDQUFDLENBQUE7QUFDcEIsQ0FBQztBQUNELFNBQVMsVUFBVSxDQUFJLEtBQVE7SUFDN0IsTUFBTSxNQUFNLEdBQUcsbUJBQW1CLENBQUMsS0FBSyxDQUFDLENBQUE7SUFDekMsT0FBTyxNQUFNLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsU0FBUyxDQUFDLENBQUE7QUFDN0MsQ0FBQztBQU1EOzs7Ozs7Ozs7Ozs7OztHQWNHO0FBRUgsTUFBTSxVQUFVLE1BQU0sQ0FDcEIsUUFBdUMsRUFDdkMsR0FBRyxJQUFtQjtJQUV0QixJQUFJLE9BQU8sUUFBUSxLQUFLLFVBQVUsSUFBSSxDQUFDLENBQUMsTUFBTSxJQUFJLFFBQVEsQ0FBQyxFQUFFO1FBQzNELElBQUk7WUFDRixJQUFJLElBQUksQ0FBQyxNQUFNO2dCQUFFLFFBQVEsR0FBRyxRQUFRLENBQUMsR0FBRyxJQUFJLENBQUMsQ0FBQTs7Z0JBQ3hDLFFBQVEsR0FBRyxRQUFRLEVBQUUsQ0FBQTtTQUMzQjtRQUFDLE9BQU8sQ0FBYyxFQUFFO1lBQ3ZCLE9BQU8sT0FBTyxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQTtTQUN0QztLQUNGO0lBQ0QsSUFBSSxPQUFPLFFBQVEsQ0FBQyxJQUFJLEtBQUssVUFBVSxFQUFFO1FBQ3ZDLE9BQU8sUUFBUSxDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsVUFBVSxDQUFDLENBQUE7S0FDN0M7SUFDRCxPQUFPLE9BQU8sQ0FBQyxNQUFNLENBQUMsSUFBSSxTQUFTLENBQUMsR0FBRyxRQUFRLGlEQUFpRCxDQUFDLENBQUMsQ0FBQTtBQUNwRyxDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLElBQUksQ0FDbEIsUUFBMEI7SUFJMUIsT0FBTyxDQUFDLEdBQUcsSUFBaUMsRUFBRSxFQUFFLENBQUMsTUFBTSxDQUFDLFFBQVEsRUFBRSxHQUFHLElBQUksQ0FBZ0IsQ0FBQTtBQUMzRixDQUFDIn0= |
import { describe, it, expect } from 'vitest'; | ||
import { gowait } from './gowait.js'; | ||
import { gowait, wrap } from './gowait.js'; | ||
describe('gowait', () => { | ||
@@ -17,3 +17,3 @@ it('should return the result of the function', async () => { | ||
it('should return the error of the function', async () => { | ||
const func = () => Promise.reject('1234'); | ||
const func = () => new Promise((_, j) => j('1234')); | ||
const [error, result] = await gowait(func()); | ||
@@ -32,3 +32,3 @@ expect(result).toBeUndefined(); | ||
func.then = resolved.then.bind(resolved); | ||
const [err, value] = await gowait(func); | ||
const [err, value] = await gowait(func, 1); | ||
expect(value).toEqual('abcd'); | ||
@@ -49,3 +49,13 @@ expect(err).toBeNull(); | ||
}); | ||
it('should allow wrapping / currying a function', async () => { | ||
const func = (arg) => { | ||
return Promise.reject(new Error(arg.toString())); | ||
}; | ||
const wrapped = wrap(func); | ||
// an <Error> type is required | ||
const [error, result] = await wrapped(1234); | ||
expect(result).toBeUndefined(); | ||
expect(error).toEqual(new Error((1234).toString())); | ||
}); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ293YWl0LnNwZWMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZ293YWl0LnNwZWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxFQUFFLEVBQUUsTUFBTSxFQUFFLE1BQU0sUUFBUSxDQUFBO0FBQzdDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxhQUFhLENBQUE7QUFFcEMsUUFBUSxDQUFDLFFBQVEsRUFBRSxHQUFHLEVBQUU7SUFDdEIsRUFBRSxDQUFDLDBDQUEwQyxFQUFFLEtBQUssSUFBSSxFQUFFO1FBQ3hELE1BQU0sSUFBSSxHQUFHLEdBQUcsRUFBRSxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUE7UUFDMUMsTUFBTSxDQUFDLENBQUMsRUFBRSxNQUFNLENBQUMsR0FBRyxNQUFNLE1BQU0sQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFBO1FBQ3hDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQ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sRUFBRSxDQUFBO1FBQzlCLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxPQUFPLENBQUMsSUFBSSxLQUFLLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDLENBQUE7SUFDckQsQ0FBQyxDQUFDLENBQUE7QUFDSixDQUFDLENBQUMsQ0FBQSJ9 |
{ | ||
"name": "aceink", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Async tools", | ||
@@ -5,0 +5,0 @@ "type": "module", |
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
91245
1320