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

@abadi199/maybe

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abadi199/maybe - npm Package Compare versions

Comparing version

to
1.1.0

15

dist/index.js

@@ -27,2 +27,5 @@ "use strict";

};
Nothing.prototype.do = function (_f) {
return this;
};
return Nothing;

@@ -55,2 +58,8 @@ }());

};
Just.prototype.do = function (f) {
if (this.value) {
f(this.value);
}
return this;
};
return Just;

@@ -60,4 +69,8 @@ }());

function just(value) {
return new Just(value);
return value ? new Just(value) : nothing();
}
exports.just = just;
function maybe(value) {
return just(value);
}
exports.maybe = maybe;

2

package.json
{
"name": "@abadi199/maybe",
"version": "1.0.1",
"version": "1.1.0",
"description": "A DataType Representing the concept of null in more safer way.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -13,2 +13,3 @@ export enum MaybeKind {

withDefault(payload: data): data;
do(f: (payload: data) => void): Maybe<data>;
}

@@ -33,2 +34,5 @@

}
do(_f: (payload: data) => void): Maybe<data> {
return this;
}
}

@@ -57,2 +61,8 @@

}
do(f: (payload: data) => void): Maybe<data> {
if (this.value) {
f(this.value);
}
return this;
}

@@ -66,2 +76,6 @@ constructor(public value: data) {}

export function maybe<data>(value: data): Maybe<data> {
return just(value);
}
export type Maybe<data> = Nothing<data> | Just<data>;