ts-results
Advanced tools
Comparing version 3.1.1 to 3.2.0
@@ -46,4 +46,4 @@ interface BaseOption<T> extends Iterable<T extends Iterable<infer U> ? U : never> { | ||
unwrap(): never; | ||
map<T2>(_mapper: (val: never) => T2): None; | ||
andThen<T2>(op: (val: never) => Option<T2>): None; | ||
map<T2>(_mapper: unknown): None; | ||
andThen<T2>(op: unknown): None; | ||
toString(): string; | ||
@@ -85,6 +85,6 @@ } | ||
export declare type Some<T> = SomeImpl<T>; | ||
export declare type Option<T> = (Some<T> | None) & BaseOption<T>; | ||
export declare type OptionSomeType<T extends Option<any>> = T extends Option<infer U> ? U : never; | ||
export declare type Option<T> = Some<T> | None; | ||
export declare type OptionSomeType<T extends Option<any>> = T extends Some<infer U> ? U : never; | ||
export declare type OptionSomeTypes<T extends Option<any>[]> = { | ||
[key in keyof T]: T[key] extends Option<infer U> ? U : never; | ||
[key in keyof T]: T[key] extends Option<any> ? OptionSomeType<T[key]> : never; | ||
}; | ||
@@ -91,0 +91,0 @@ export declare namespace Option { |
{ | ||
"name": "ts-results", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "A typescript implementation of Rust's Result and Option objects.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -69,4 +69,4 @@ interface BaseResult<T, E> extends Iterable<T extends Iterable<infer U> ? U : never> { | ||
unwrap(): never; | ||
map<T2>(_mapper: (val: never) => T2): Err<E>; | ||
andThen<T2, E2>(op: (val: never) => Result<T2, E2>): Err<E>; | ||
map(_mapper: unknown): Err<E>; | ||
andThen<T2, E2>(op: unknown): Err<E>; | ||
mapErr<E2>(mapper: (err: E) => E2): Err<E2>; | ||
@@ -100,3 +100,3 @@ toString(): string; | ||
andThen<T2, E2>(mapper: (val: T) => Result<T2, E2>): Result<T2, E2>; | ||
mapErr<E2>(_mapper: (err: never) => E2): Ok<T>; | ||
mapErr(_mapper: unknown): Ok<T>; | ||
/** | ||
@@ -116,10 +116,10 @@ * Returns the contained `Ok` value, but never throws. | ||
export declare type Ok<T> = OkImpl<T>; | ||
export declare type Result<T, E> = (Ok<T> | Err<E>) & BaseResult<T, E>; | ||
export declare type ResultOkType<T extends Result<any, any>> = T extends Result<infer U, any> ? U : never; | ||
export declare type ResultErrType<T extends Result<any, any>> = T extends Result<any, infer U> ? U : never; | ||
export declare type Result<T, E> = Ok<T> | Err<E>; | ||
export declare type ResultOkType<T extends Result<any, any>> = T extends Ok<infer U> ? U : never; | ||
export declare type ResultErrType<T> = T extends Err<infer U> ? U : never; | ||
export declare type ResultOkTypes<T extends Result<any, any>[]> = { | ||
[key in keyof T]: T[key] extends Result<infer U, any> ? U : never; | ||
[key in keyof T]: T[key] extends Result<infer U, any> ? ResultOkType<T[key]> : never; | ||
}; | ||
export declare type ResultErrTypes<T extends Result<any, any>[]> = { | ||
[key in keyof T]: T[key] extends Result<any, infer U> ? U : never; | ||
[key in keyof T]: T[key] extends Result<infer U, any> ? ResultErrType<T[key]> : never; | ||
}; | ||
@@ -126,0 +126,0 @@ export declare namespace Result { |
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
91853