mirror of
https://github.com/hanzoai/es5-ext.git
synced 2026-09-24 16:58:43 +00:00
feat: array.isEmpty method
This commit is contained in:
@@ -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"),
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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");
|
||||
};
|
||||
Reference in New Issue
Block a user