From 1899f470ee95c3139f69a52a9eb9e6aa90c8e9a9 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 22 Sep 2014 15:30:22 +0200 Subject: [PATCH] add Ox.isNodeList --- source/Ox/js/Type.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/Ox/js/Type.js b/source/Ox/js/Type.js index e667e491..0c09ad2e 100644 --- a/source/Ox/js/Type.js +++ b/source/Ox/js/Type.js @@ -252,6 +252,16 @@ Ox.isNaN = function(value) { return value !== value; }; +/*@ +Ox.isNodeList Tests if a value is a nodelist + (value) -> True is the value is a nodelist + > Ox.isNodeList(document.getElementsByTagName('a')) + true +@*/ +Ox.isNodeList = function(value) { + return Ox.typeOf(value) == 'nodelist'; +}; + /*@ Ox.isNull Tests if a value is `null` (value) -> True if the value is `null`