Skip to content

Commit

Permalink
added is methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Petrac committed May 30, 2022
1 parent 9f4ced6 commit a943946
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/is.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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);
};
Expand Down

0 comments on commit a943946

Please sign in to comment.