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

ts-results

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-results - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0-beta.1

rxjs-operators.d.ts

28

index.d.ts

@@ -9,7 +9,22 @@ interface BaseResult<T, E> {

*/
else(val: T): T;
else<T2>(val: T2): T | T2;
unwrap(): T;
expect(msg: string): T;
asErr(): Result<never, E>;
asOk(): Result<T, never>;
/**
* This value doesn't exist at runtime! It's only used so that we can extract the type E given Result<T, E>
*/
_e: E;
/**
* This value doesn't exist at runtime! It's only used so that we can extract the type T given Result<T, E>
*/
_t: T;
}
export interface Ok<T, E> extends BaseResult<T, E> {
export interface Ok<T = any, E = never> extends BaseResult<T, E> {
readonly ok: true;
readonly err: false;
readonly val: T;
}
export interface Err<T = never, E = any> extends BaseResult<T, E> {
readonly ok: false;

@@ -19,10 +34,5 @@ readonly err: true;

}
export interface Err<T, E> extends BaseResult<T, E> {
readonly ok: true;
readonly err: false;
readonly val: T;
}
export declare type Result<T, E> = Ok<T, E> | Err<T, E>;
export declare function Ok<T, E>(val: T): Result<T, E>;
export declare function Err<T, E>(val: E): Result<T, E>;
export declare function Ok<T, E = never>(val: T): Result<T, E>;
export declare function Err<T = never, E = any>(val: E): Result<T, E>;
export declare function Results<T1, E1, T2, E2>(result1: Result<T1, E1>, result2: Result<T2, E2>): Result<[T1, T2], E1 | E2>;

@@ -29,0 +39,0 @@ export declare function Results<T1, E1, T2, E2, T3, E3>(result1: Result<T1, E1>, result2: Result<T2, E2>, result3: Result<T3, E3>): Result<[T1, T2, T3], E1 | E2 | E3>;

@@ -50,3 +50,3 @@ class ResultImpl {

}
asError() {
asErr() {
return this;

@@ -53,0 +53,0 @@ }

{
"name": "ts-results",
"version": "1.0.5",
"version": "1.1.0-beta.1",
"description": "A typescript implementation of Rust's Result object.",

@@ -14,3 +14,6 @@ "main": "index.js",

},
"peerDependencies": {
"rxjs": "^6.1.0"
},
"readme": "README.md"
}

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