return-style
Advanced tools
Comparing version 0.11.6 to 0.12.0
@@ -5,2 +5,13 @@ # Changelog | ||
## [0.12.0](https://github.com/BlackGlory/return-style/compare/v0.11.6...v0.12.0) (2021-02-06) | ||
### ⚠ BREAKING CHANGES | ||
* function signatures changed | ||
### Features | ||
* modify function signatures ([e0a9711](https://github.com/BlackGlory/return-style/commit/e0a9711475d15a5c12661d1f0fff6fa8de4e1c68)) | ||
### [0.11.6](https://github.com/BlackGlory/return-style/compare/v0.11.5...v0.11.6) (2021-02-03) | ||
@@ -7,0 +18,0 @@ |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorAsyncIterable<T = Error>(iterable: AsyncIterable<unknown>): Promise<T | undefined>; | ||
export declare function getErrorAsyncIterable<X = Error>(iterable: AsyncIterable<unknown>): Promise<X | undefined>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorAsync<T = Error>(fn: () => PromiseLike<unknown>): Promise<T | undefined>; | ||
export declare function getErrorAsync<X = Error>(fn: () => PromiseLike<unknown>): Promise<X | undefined>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorPromise<T = Error>(promise: PromiseLike<unknown>): Promise<T | undefined>; | ||
export declare function getErrorPromise<X = Error>(promise: PromiseLike<unknown>): Promise<X | undefined>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorResultAsync<T, X = any>(fn: () => PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>; | ||
export declare function getErrorResultAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorResultPromise<T, X = any>(promise: PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>; | ||
export declare function getErrorResultPromise<X = Error, T = unknown>(promise: PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorResult<T, X = any>(fn: () => T): [undefined, T] | [X, undefined]; | ||
export declare function getErrorResult<X = Error, T = unknown>(fn: () => T): [undefined, T] | [X, undefined]; |
@@ -1,1 +0,1 @@ | ||
export declare function getError<T = Error>(fn: () => unknown): T | undefined; | ||
export declare function getError<X = Error>(fn: () => unknown): X | undefined; |
@@ -1,1 +0,1 @@ | ||
export declare function getFailureAsync<X>(fn: () => PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>; | ||
export declare function getFailureAsync<X = Error>(fn: () => PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getFailurePromise<X>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>; | ||
export declare function getFailurePromise<X = Error>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getFailure<X>(fn: () => unknown): [true, X] | [false, undefined]; | ||
export declare function getFailure<X = Error>(fn: () => unknown): [true, X] | [false, undefined]; |
@@ -1,1 +0,1 @@ | ||
export declare function getResultErrorAsync<T, X = any>(fn: () => PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>; | ||
export declare function getResultErrorAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getResultErrorPromise<T, X = any>(promise: PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>; | ||
export declare function getResultErrorPromise<X = Error, T = unknown>(promise: PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getResultError<T, X = any>(fn: () => T): [T, undefined] | [undefined, X]; | ||
export declare function getResultError<X = Error, T = unknown>(fn: () => T): [T, undefined] | [undefined, X]; |
import { IAsyncOptional } from '../classes/async-optional'; | ||
export declare function toOptionalPromisePartial<T>(isNone: (val: T) => boolean): (promise: PromiseLike<T>) => IAsyncOptional<T>; | ||
export declare function toOptionalPromise<T>(promise: PromiseLike<T>, isNone: (val: T) => boolean): IAsyncOptional<T>; | ||
export declare function toOptionalPromise<T = unknown>(promise: PromiseLike<T>, isNone: (val: T) => boolean): IAsyncOptional<T>; |
import { IOptional } from '../classes/optional'; | ||
export declare function toOptionalPartial<T>(isNone: (val: T) => boolean): (fn: () => T) => IOptional<T>; | ||
export declare function toOptional<T>(fn: () => T, isNone: (val: T) => boolean): IOptional<T>; | ||
export declare function toOptional<T = unknown>(fn: () => T, isNone: (val: T) => boolean): IOptional<T>; |
import { IAsyncResult } from '../classes/async-result'; | ||
export declare function toResultAsync<T, X = any>(fn: () => PromiseLike<T>): IAsyncResult<T, X>; | ||
export declare function toResultAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): IAsyncResult<T, X>; |
import { IAsyncResult } from '../classes/async-result'; | ||
export declare function toResultPromise<T, X = any>(promise: PromiseLike<T>): IAsyncResult<T, X>; | ||
export declare function toResultPromise<X = Error, T = unknown>(promise: PromiseLike<T>): IAsyncResult<T, X>; |
import { IResult } from '../classes/result'; | ||
export declare function toResult<T, X = any>(fn: () => T): IResult<T, X>; | ||
export declare function toResult<X = Error, T = unknown>(fn: () => T): IResult<T, X>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorAsyncIterable<T = Error>(iterable: AsyncIterable<unknown>): Promise<T | undefined>; | ||
export declare function getErrorAsyncIterable<X = Error>(iterable: AsyncIterable<unknown>): Promise<X | undefined>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorAsync<T = Error>(fn: () => PromiseLike<unknown>): Promise<T | undefined>; | ||
export declare function getErrorAsync<X = Error>(fn: () => PromiseLike<unknown>): Promise<X | undefined>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorPromise<T = Error>(promise: PromiseLike<unknown>): Promise<T | undefined>; | ||
export declare function getErrorPromise<X = Error>(promise: PromiseLike<unknown>): Promise<X | undefined>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorResultAsync<T, X = any>(fn: () => PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>; | ||
export declare function getErrorResultAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorResultPromise<T, X = any>(promise: PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>; | ||
export declare function getErrorResultPromise<X = Error, T = unknown>(promise: PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getErrorResult<T, X = any>(fn: () => T): [undefined, T] | [X, undefined]; | ||
export declare function getErrorResult<X = Error, T = unknown>(fn: () => T): [undefined, T] | [X, undefined]; |
@@ -1,1 +0,1 @@ | ||
export declare function getError<T = Error>(fn: () => unknown): T | undefined; | ||
export declare function getError<X = Error>(fn: () => unknown): X | undefined; |
@@ -1,1 +0,1 @@ | ||
export declare function getFailureAsync<X>(fn: () => PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>; | ||
export declare function getFailureAsync<X = Error>(fn: () => PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getFailurePromise<X>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>; | ||
export declare function getFailurePromise<X = Error>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getFailure<X>(fn: () => unknown): [true, X] | [false, undefined]; | ||
export declare function getFailure<X = Error>(fn: () => unknown): [true, X] | [false, undefined]; |
@@ -1,1 +0,1 @@ | ||
export declare function getResultErrorAsync<T, X = any>(fn: () => PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>; | ||
export declare function getResultErrorAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getResultErrorPromise<T, X = any>(promise: PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>; | ||
export declare function getResultErrorPromise<X = Error, T = unknown>(promise: PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>; |
@@ -1,1 +0,1 @@ | ||
export declare function getResultError<T, X = any>(fn: () => T): [T, undefined] | [undefined, X]; | ||
export declare function getResultError<X = Error, T = unknown>(fn: () => T): [T, undefined] | [undefined, X]; |
import { IAsyncOptional } from '../classes/async-optional'; | ||
export declare function toOptionalPromisePartial<T>(isNone: (val: T) => boolean): (promise: PromiseLike<T>) => IAsyncOptional<T>; | ||
export declare function toOptionalPromise<T>(promise: PromiseLike<T>, isNone: (val: T) => boolean): IAsyncOptional<T>; | ||
export declare function toOptionalPromise<T = unknown>(promise: PromiseLike<T>, isNone: (val: T) => boolean): IAsyncOptional<T>; |
import { IOptional } from '../classes/optional'; | ||
export declare function toOptionalPartial<T>(isNone: (val: T) => boolean): (fn: () => T) => IOptional<T>; | ||
export declare function toOptional<T>(fn: () => T, isNone: (val: T) => boolean): IOptional<T>; | ||
export declare function toOptional<T = unknown>(fn: () => T, isNone: (val: T) => boolean): IOptional<T>; |
import { IAsyncResult } from '../classes/async-result'; | ||
export declare function toResultAsync<T, X = any>(fn: () => PromiseLike<T>): IAsyncResult<T, X>; | ||
export declare function toResultAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): IAsyncResult<T, X>; |
import { IAsyncResult } from '../classes/async-result'; | ||
export declare function toResultPromise<T, X = any>(promise: PromiseLike<T>): IAsyncResult<T, X>; | ||
export declare function toResultPromise<X = Error, T = unknown>(promise: PromiseLike<T>): IAsyncResult<T, X>; |
import { IResult } from '../classes/result'; | ||
export declare function toResult<T, X = any>(fn: () => T): IResult<T, X>; | ||
export declare function toResult<X = Error, T = unknown>(fn: () => T): IResult<T, X>; |
{ | ||
"name": "return-style", | ||
"version": "0.11.6", | ||
"version": "0.12.0", | ||
"description": "Non-intrusively convert the result of any function or promise to the user's desired style.", | ||
@@ -58,4 +58,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@blackglory/jest-matchers": "^0.1.7", | ||
"@blackglory/types": "^0.2.11", | ||
"@blackglory/jest-matchers": "^0.1.9", | ||
"@blackglory/types": "^0.2.14", | ||
"@commitlint/cli": "^11.0.0", | ||
@@ -65,3 +65,3 @@ "@commitlint/config-conventional": "^11.0.0", | ||
"@types/jest": "^26.0.20", | ||
"@types/node": "^14.14.22", | ||
"@types/node": "^14.14.25", | ||
"@typescript-eslint/eslint-plugin": "^4.14.2", | ||
@@ -71,3 +71,3 @@ "@typescript-eslint/parser": "^4.14.2", | ||
"husky": "^4.3.8", | ||
"iterable-operator": "^0.13.0", | ||
"iterable-operator": "^0.13.2", | ||
"jest": "^26.6.3", | ||
@@ -77,3 +77,3 @@ "jest-extended": "^0.11.5", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.38.4", | ||
"rollup": "^2.38.5", | ||
"rollup-plugin-analyzer": "^4.0.0", | ||
@@ -80,0 +80,0 @@ "rollup-plugin-terser": "^7.0.2", |
@@ -89,6 +89,6 @@ # return-style | ||
- `function getError<T>(fn: () => unknown): T | undefined` | ||
- `function getErrorAsync<T>(fn: () => PromiseLike<unknown>): Promise<T | undefined>` | ||
- `function getErrorPromise<T>(promise: PromiseLike<unknown>): Promise<T | undefined>` | ||
- `function getErrorAsyncIterable<T>(iterable: AsyncIterable<unknown>): Promise<T | undefined>` | ||
- `function getError<X>(fn: () => unknown): X | undefined` | ||
- `function getErrorAsync<X>(fn: () => PromiseLike<unknown>): Promise<X | undefined>` | ||
- `function getErrorPromise<X>(promise: PromiseLike<unknown>): Promise<X | undefined>` | ||
- `function getErrorAsyncIterable<X>(iterable: AsyncIterable<unknown>): Promise<X | undefined>` | ||
@@ -134,5 +134,5 @@ ```js | ||
- `function getErrorResult<T, X = any>(fn: () => T): [undefined, T] | [X, undefined]` | ||
- `function getErrorResultAsync<X, T = any>(fn: () => PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>` | ||
- `function getErrorResultPromise<X, T = any>(promise: PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>` | ||
- `function getErrorResult<X = Error, T = unknown>(fn: () => T): [undefined, T] | [X, undefined]` | ||
- `function getErrorResultAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>` | ||
- `function getErrorResultPromise<X = Error, T = unknown>(promise: PromiseLike<T>): Promise<[undefined, T] | [X, undefined]>` | ||
@@ -154,5 +154,5 @@ ```ts | ||
- `function getResultError<T, X = any>(fn: () => T): [T, undefined] | [undefined, X]` | ||
- `function getResultErrorAsync<T, X = any>(fn: () => PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>` | ||
- `function getResultErrorPromise<T, X = any>(promise: PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>` | ||
- `function getResultError<X = Error, T = unknown>(fn: () => T): [T, undefined] | [undefined, X]` | ||
- `function getResultErrorAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>` | ||
- `function getResultErrorPromise<X = Error, T = unknown>(promise: PromiseLike<T>): Promise<[T, undefined] | [undefined, X]>` | ||
@@ -190,5 +190,5 @@ ```ts | ||
- `function getFailure<X>(fn: () => unknown): [true, X] | [false, undefined]` | ||
- `function getFailureAsync<X>(fn: () => PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>` | ||
- `function getFailurePromise<X>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>` | ||
- `function getFailure<X = Error>(fn: () => unknown): [true, X] | [false, undefined]` | ||
- `function getFailureAsync<X = Error>(fn: () => PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>` | ||
- `function getFailurePromise<X = Error>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>` | ||
@@ -207,5 +207,5 @@ ```ts | ||
- `function toResult<T, X = any>(fn: () => T): Result<T, X>` | ||
- `function toResultAsync<T, X = any>(fn: () => PromiseLike<T>): AsyncResult<T, X>` | ||
- `function toResultPromise<T, X = any>(promise: PromiseLike<T>): AsyncResult<T, X>` | ||
- `function toResult<X = Error, T = unknown>(fn: () => T): Result<T, X>` | ||
- `function toResultAsync<X = Error, T = unknown>(fn: () => PromiseLike<T>): AsyncResult<T, X>` | ||
- `function toResultPromise<X = Error, T = unknown>(promise: PromiseLike<T>): AsyncResult<T, X>` | ||
@@ -212,0 +212,0 @@ ```ts |
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
579460