nullthrows
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,2 +5,2 @@ /** | ||
export default function nullthrows<T>(value?: T | null): T; | ||
export default function nullthrows<T>(value?: T | null, message?: string): T; |
@@ -5,7 +5,7 @@ 'use strict'; | ||
exports.default = function nullthrows(x) { | ||
exports.default = function nullthrows(x, message) { | ||
if (x != null) { | ||
return x; | ||
} | ||
throw new Error('Got unexpected null or undefined'); | ||
throw new Error(message !== undefined ? message : 'Got unexpected null or undefined'); | ||
}; |
{ | ||
"name": "nullthrows", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "flow typed nullthrows", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
2685