New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-result

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-result - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

22

lib/index.d.ts

@@ -1,15 +0,13 @@

declare type ResultError = Error;
declare type ResultData = null | void | string | number | boolean | object | any[];
declare type ErrorProcessing = (error: ResultError) => ResultData;
declare type ErrorProcessingAsync = (error: ResultError) => Promise<ResultData>;
export declare class Result {
declare type ErrorProcessing<Error, Data> = (error: Error) => Data;
declare type ErrorProcessingAsync<Error, Data> = (error: Error) => Promise<Data>;
export declare class Result<Error, Data> {
#private;
constructor(error: Error | null | undefined, data: ResultData);
unwrap(): ResultData;
unwrapAsync(): Promise<ResultData>;
onError(func: ErrorProcessing): ResultData;
onErrorAsync(func: ErrorProcessingAsync): Promise<ResultData>;
constructor(error: Error | null | undefined, data: Data);
unwrap(): Data;
unwrapAsync(): Promise<Data>;
onError(func: ErrorProcessing<Error, Data>): Data;
onErrorAsync(func: ErrorProcessingAsync<Error, Data>): Promise<Data>;
}
export declare const ResultOk: (data: ResultData) => Result;
export declare const ResultFail: (error: ResultError) => Result;
export declare const ResultOk: <Data>(data: Data) => Result<null, Data>;
export declare const ResultFail: <Error_1>(error: Error_1) => Result<Error_1, undefined>;
export {};
{
"name": "node-result",
"type": "module",
"version": "1.1.0",
"version": "2.0.0",
"description": "result",

@@ -6,0 +6,0 @@ "keywords": [

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