From 0ae15450d8ecb9f385a0f15a3959a5e37a7a1e0c Mon Sep 17 00:00:00 2001 From: Angel Grablev Date: Tue, 12 Sep 2017 09:55:19 -0700 Subject: [PATCH] Improved accessibility and detection Now you can actually ask axis what IS the item :) instead of just comparing. --- src/axis.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/axis.js b/src/axis.js index 155226a..cb95f71 100644 --- a/src/axis.js +++ b/src/axis.js @@ -14,14 +14,14 @@ var types = 'Array Object String Date RegExp Function Boolean Number Null Undefined'.split(' '); - function type() { - return Object.prototype.toString.call(this).slice(8, -1); + axis.type = function(item) { + return Object.prototype.toString.call(item).slice(8, -1); } for (var i = types.length; i--;) { axis['is' + types[i]] = (function (self) { return function (elem) { - return type.call(elem) === self; + return axis.type(elem) === self; }; })(types[i]); }