diff --git a/dist/util.d.ts.map b/dist/util.d.ts.map index 876e5eb..159e9ae 100644 --- a/dist/util.d.ts.map +++ b/dist/util.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAWA,wBAAgB,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,GAAG,GAAG,EAAE,CAuC1D"} \ No newline at end of file +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAaA,wBAAgB,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,GAAG,GAAG,EAAE,CA0C1D"} \ No newline at end of file diff --git a/dist/util.js b/dist/util.js index 91bc79e..fdeabb1 100644 --- a/dist/util.js +++ b/dist/util.js @@ -15,7 +15,10 @@ export function flatten(target, opts = {}) { const output = []; function step(object, prev, currentDepth) { currentDepth = currentDepth || 1; - Object.keys(object).forEach(function (key) { + if (!Array.isArray(object)) { + object = Object.keys(object); + } + object.forEach(function (key) { const value = object[key]; const isarray = opts.safe && Array.isArray(value); const type = Object.prototype.toString.call(value);