@typed/maybe
Advanced tools
Comparing version 4.1.0 to 5.0.0
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
58309
+ Added@typed/functions@2.2.0(transitive)
- Removed@typed/functions@2.1.0(transitive)
Updated@typed/functions@2.2.0