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 2.3.0 to 2.3.1

2

cjs/index.d.ts

@@ -34,3 +34,3 @@ import type { Monad, Alternative } from "@sweet-monads/interfaces";

static fromNullable<T>(v: T): Maybe<Exclude<T, null | undefined>>;
static none<T>(): Maybe<T>;
static none<T = never>(): Maybe<T>;
static just<T>(v: T): Maybe<T>;

@@ -37,0 +37,0 @@ private constructor();

@@ -21,11 +21,11 @@ "use strict";

static merge(maybies) {
return maybies.reduce((res, v) => v.chain(v => res.map(res => res.concat([v]))), MaybeConstructor.just([]));
return maybies.reduce((res, v) => res.chain(res => v.map(v => res.concat([v]))), MaybeConstructor.just([]));
}
static from(v) {
return this.just(v);
return MaybeConstructor.just(v);
}
static fromNullable(v) {
return v !== null && v !== undefined
? this.just(v)
: this.none();
? MaybeConstructor.just(v)
: MaybeConstructor.none();
}

@@ -32,0 +32,0 @@ static none() {

@@ -34,3 +34,3 @@ import type { Monad, Alternative } from "@sweet-monads/interfaces";

static fromNullable<T>(v: T): Maybe<Exclude<T, null | undefined>>;
static none<T>(): Maybe<T>;
static none<T = never>(): Maybe<T>;
static just<T>(v: T): Maybe<T>;

@@ -37,0 +37,0 @@ private constructor();

@@ -18,11 +18,11 @@ var MaybeState;

static merge(maybies) {
return maybies.reduce((res, v) => v.chain(v => res.map(res => res.concat([v]))), MaybeConstructor.just([]));
return maybies.reduce((res, v) => res.chain(res => v.map(v => res.concat([v]))), MaybeConstructor.just([]));
}
static from(v) {
return this.just(v);
return MaybeConstructor.just(v);
}
static fromNullable(v) {
return v !== null && v !== undefined
? this.just(v)
: this.none();
? MaybeConstructor.just(v)
: MaybeConstructor.none();
}

@@ -29,0 +29,0 @@ static none() {

@@ -34,3 +34,3 @@ import type { Monad, Alternative } from "@sweet-monads/interfaces";

static fromNullable<T>(v: T): Maybe<Exclude<T, null | undefined>>;
static none<T>(): Maybe<T>;
static none<T = never>(): Maybe<T>;
static just<T>(v: T): Maybe<T>;

@@ -37,0 +37,0 @@ private constructor();

{
"name": "@sweet-monads/maybe",
"version": "2.3.0",
"version": "2.3.1",
"description": "",

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

@@ -12,6 +12,6 @@ # @sweet-monads/maybe

- Check out all libraries:
[either](https://github.com/JSMonk/sweet-monads/tree/master/either),
[either](https://github.com/JSMonk/sweet-monads/tree/master/either),
[iterator](https://github.com/JSMonk/sweet-monads/tree/master/iterator),
[interfaces](https://github.com/JSMonk/sweet-monads/tree/master/interfaces),
[maybe](https://github.com/JSMonk/sweet-monads/tree/master/maybe),
[maybe](https://github.com/JSMonk/sweet-monads/tree/master/maybe)

@@ -109,3 +109,3 @@ ## Usage

```typescript
const v1 = none(); // Maybe<unknown>.None
const v1 = none(); // Maybe<never>.None
const v2 = none<number>(); // Maybe<number>.None

@@ -112,0 +112,0 @@ ```

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