feat: array.isEmpty method

This commit is contained in:
Mariusz Nowak
2017-08-18 12:48:25 +02:00
parent 595c341481
commit b0cfbdd6c4
3 changed files with 17 additions and 0 deletions
+1
View File
@@ -26,6 +26,7 @@ module.exports = {
"indexesOf": require("./indexes-of"),
"intersection": require("./intersection"),
"isCopy": require("./is-copy"),
"isEmpty": require("./is-empty"),
"isUniq": require("./is-uniq"),
"last": require("./last"),
"lastIndex": require("./last-index"),
+8
View File
@@ -0,0 +1,8 @@
"use strict";
var ensureArray = require("../../object/ensure-array")
, firstIndex = require("./first-index");
module.exports = function () {
return firstIndex.call(ensureArray(this)) === null;
};
+8
View File
@@ -0,0 +1,8 @@
"use strict";
module.exports = function (t, a) {
var x = {};
a(t.call([]), true, "Empty");
a(t.call({ length: 0 }), true, "Empty lists");
a(t.call([1, x, "raz"]), false, "Non empty");
};