From a943946412977769ce873b559a9e0ca3c93b2c34 Mon Sep 17 00:00:00 2001 From: Simon Petrac Date: Mon, 30 May 2022 12:08:15 +0200 Subject: [PATCH] added is methods --- src/is.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/is.js b/src/is.js index 10bc0f3..8598096 100644 --- a/src/is.js +++ b/src/is.js @@ -24,6 +24,14 @@ is.boolean = function (value) { return typeof value === 'boolean'; }; +is.boolean.true = function (value) { + return value === true; +}; + +is.boolean.false = function (value) { + return value === false; +}; + is.truthy = function (value) { return !!value; }; @@ -108,6 +116,10 @@ is.object = function (value) { return value && typeof value === 'object'; }; +is.object.null = function (value) { + return value === null; +}; + is.object.nonempty = function (value) { return is.object(value) && Object.values(value).some(is.not.null); };