aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js
index 2fb18e0d..7ab9e1ed 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -188,6 +188,14 @@ function isNumber(x) {
return x == parseFloat(x);
}
+function isArray(x) {
+ try {
+ return typeof x === 'object' && 'length' in x && 'slice' in x;
+ } catch(e) {
+ return false;
+ }
+}
+
function flatten(x) {
if (typeof x !== 'object') return x;
var ret = [];