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

@sweet-monads/maybe

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sweet-monads/maybe - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

4

index.d.ts

@@ -15,2 +15,3 @@ import { Monad } from "@sweet-monads/interfaces";

static merge<V1, V2, V3, V4, V5, V6, V7, V8, V9, L10, V10>(values: [Maybe<V1>, Maybe<V2>, Maybe<V3>, Maybe<V4>, Maybe<V5>, Maybe<V6>, Maybe<V7>, Maybe<V8>, Maybe<V9>, Maybe<V10>]): Maybe<[V1, V2, V3, V4, V5, V6, V7, V8, V9, V10]>;
static from<T>(v: T): Maybe<T>;
static none<T>(): Maybe<T>;

@@ -22,4 +23,7 @@ static just<T>(v: T): Maybe<T>;

isJust(): boolean;
join<V>(this: Maybe<Maybe<V>>): Maybe<V>;
map<V>(f: (r: T) => V): Maybe<V>;
asyncMap<V>(f: (r: T) => Promise<V>): Promise<Maybe<V>>;
chain<V>(f: (r: T) => Maybe<V>): Maybe<V>;
asyncChain<V>(f: (r: T) => Promise<Maybe<V>>): Promise<Maybe<V>>;
}

@@ -13,2 +13,5 @@ const MaybeState = {

}
static from(v) {
return this.just(v);
}
static none() {

@@ -26,2 +29,5 @@ return new Maybe(MaybeState.None);

}
join() {
return this.chain(x => x);
}
map(f) {

@@ -33,2 +39,8 @@ if (this.isJust()) {

}
asyncMap(f) {
if (this.isNone()) {
return Promise.resolve(Maybe.none());
}
return f(this.value).then(v => Maybe.just(v));
}
chain(f) {

@@ -40,2 +52,8 @@ if (this.isNone()) {

}
asyncChain(f) {
if (this.isNone()) {
return Promise.resolve(Maybe.none());
}
return f(this.value);
}
}

4

package.json
{
"name": "@sweet-monads/maybe",
"version": "1.0.1",
"version": "1.1.0",
"description": "",

@@ -13,3 +13,3 @@ "main": "index.js",

"dependencies": {
"@sweet-monads/interfaces": "^1.0.1"
"@sweet-monads/interfaces": "^1.1.0"
},

@@ -16,0 +16,0 @@ "author": "",

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