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.0.0 to 2.1.0

index.ts

4

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

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

"dependencies": {
"@sweet-monads/interfaces": "^1.2.0"
"@sweet-monads/interfaces": "^1.3.0"
},

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

@@ -42,2 +42,3 @@ # @sweet-monads/maybe

- [`Maybe#isJust`](#maybeisjust)
- [`Maybe#or`](#maybeor)
- [`Maybe#join`](#maybejoin)

@@ -150,2 +151,24 @@ - [`Maybe#map`](#maybemap)

#### `Maybe#or`
```typescript
function or<T>(x: Maybe<T>): Maybe<T>;
```
- Returns `Maybe<T>`. If state of `this` is `Just` then `this` will be returned otherwise `x` argument will be returned
Example:
```typescript
const v1 = just(2);
const v2 = none();
const v3 = none();
const v4 = none();
v1.or(v2) // v1 will be returned
v2.or(v1) // v1 will be returned
v2.or(v3) // v3 will be returned
v1.or(v4) // v1 will be returned
v2.or(v3).or(v1) // v1 will be returned
v2.or(v1).or(v3) // v1 will be returned
v1.or(v2).or(v3) // v1 will be returned
```
#### `Maybe#join`

@@ -152,0 +175,0 @@ ```typescript

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