Socket
Socket
Sign inDemoInstall

@typed/maybe

Package Overview
Dependencies
2
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.0 to 5.0.0

2

lib.es2015/toMaybe.js
import { Maybe } from './Maybe';
import { Nothing } from './Nothing';
export function toMaybe(value) {
return value === void 0 ? Nothing : Maybe.of(value);
return value == null ? Nothing : Maybe.of(value);
}
//# sourceMappingURL=toMaybe.js.map

@@ -6,5 +6,5 @@ "use strict";

function toMaybe(value) {
return value === void 0 ? Nothing_1.Nothing : Maybe_1.Maybe.of(value);
return value == null ? Nothing_1.Nothing : Maybe_1.Maybe.of(value);
}
exports.toMaybe = toMaybe;
//# sourceMappingURL=toMaybe.js.map
{
"name": "@typed/maybe",
"version": "4.1.0",
"version": "5.0.0",
"description": "Well-typed Maybe data structure",

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

"@typed/core": "2.1.0",
"@typed/functions": "2.1.0"
"@typed/functions": "2.2.0"
},

@@ -22,0 +22,0 @@ "repository": {

@@ -1,2 +0,2 @@

# @typed/maybe -- 4.0.0
# @typed/maybe -- 4.1.0

@@ -3,0 +3,0 @@ Well-typed Maybe data structure

@@ -19,7 +19,7 @@ import { Test, describe, given, it } from '@typed/test'

given(`null`, [
it(`returns Just null`, ({ equal }) => {
it(`returns Nothing`, ({ ok }) => {
const value = null
const maybe = toMaybe<null>(value)
const maybe = toMaybe(value)
if (isJust(maybe)) equal(value, fromJust(maybe))
ok(isNothing(maybe))
}),

@@ -26,0 +26,0 @@ ]),

@@ -5,3 +5,3 @@ import { Maybe } from './Maybe'

export function toMaybe<A>(value: A | void): Maybe<A> {
return value === void 0 ? Nothing : Maybe.of<A>(value)
return value == null ? Nothing : Maybe.of<A>(value)
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc