*Update dist
This commit is contained in:
parent
681d3f4b9f
commit
03a5933394
|
@ -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"}
|
{"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"}
|
|
@ -15,7 +15,10 @@ export function flatten(target, opts = {}) {
|
||||||
const output = [];
|
const output = [];
|
||||||
function step(object, prev, currentDepth) {
|
function step(object, prev, currentDepth) {
|
||||||
currentDepth = currentDepth || 1;
|
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 value = object[key];
|
||||||
const isarray = opts.safe && Array.isArray(value);
|
const isarray = opts.safe && Array.isArray(value);
|
||||||
const type = Object.prototype.toString.call(value);
|
const type = Object.prototype.toString.call(value);
|
||||||
|
|
Loading…
Reference in New Issue