aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/utility.js b/src/utility.js
index 6973362d..626f9978 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -204,7 +204,11 @@ function flatten(x) {
if (typeof x !== 'object') return x;
var ret = [];
for (var i = 0; i < x.length; i++) {
- ret = ret.concat(flatten(x[i]));
+ if (typeof x[i] === 'number') {
+ ret.push(x[i]);
+ } else {
+ ret = ret.concat(flatten(x[i]));
+ }
}
return ret;
}