nou
v1.0.0
Published
shortcut methods for checking null or undefined
Maintainers
Readme
nou
nou = Null Or Undefined
Tired of writing util.isNullOrUndefined? This module is for you! It creates shortcut methods such as isNou or isNull.
Usage:
const nou = require('nou');
var x; //x is undefined
nou.isNou(null); //true
nou.isNou(x); //true
nou.isNull(null); //true
nou.isNull(x); //true
nou.isNotNou(""); //true
nou.isNotNull(""); //true
nou.isDefined(""); //trueinstallation:
npm i --save nou
this is the actual code
const isNou = (x) => x === null || x === undefined;
module.exports = {
isNou,
isNotNou: (x) => !isNou(x),
isNull: isNou,
isNotNull: (x) => !isNou(x),
isDefined: (x) => !isNou(x),
};