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.3.0 to 1.3.1

26

index.js

@@ -52,18 +52,24 @@ "use strict";

Maybe.prototype.apply = function (argOrFn) {
if (isWrappedFunction(this) && !isWrappedFunction(argOrFn)) {
if (this.isJust()) {
return argOrFn.map(this.value);
}
if (this.isNone() || argOrFn.isNone()) {
return Maybe.none();
}
return argOrFn.apply(this);
if (isWrappedFunction(this)) {
return argOrFn.map(this.value);
}
if (isWrappedFunction(argOrFn)) {
return argOrFn.apply(this);
}
throw new Error("Some of the arguments should be a function");
};
Maybe.prototype.asyncApply = function (argOrFn) {
if (isWrappedFunction(this) && !isWrappedFunction(argOrFn)) {
if (this.isJust()) {
return argOrFn.asyncMap(this.value);
}
if (this.isNone() || argOrFn.isNone()) {
return Promise.resolve(Maybe.none());
}
return argOrFn.asyncApply(this);
if (isWrappedFunction(this)) {
return argOrFn.asyncMap(this.value);
}
if (isWrappedFunction(argOrFn)) {
return argOrFn.asyncApply(this);
}
throw new Error("Some of the arguments should be a function");
};

@@ -70,0 +76,0 @@ Maybe.prototype.chain = function (f) {

{
"name": "@sweet-monads/maybe",
"version": "1.3.0",
"version": "1.3.1",
"description": "",

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

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