fix: entries as property name (#6025)
This commit is contained in:
@@ -18,6 +18,7 @@ import _memoize from "lodash/memoize"
|
||||
import find from "lodash/find"
|
||||
import some from "lodash/some"
|
||||
import eq from "lodash/eq"
|
||||
import isFunction from "lodash/isFunction"
|
||||
import { memoizedSampleFromSchema, memoizedCreateXMLExample } from "core/plugins/samples/fn"
|
||||
import win from "./window"
|
||||
import cssEscape from "css.escape"
|
||||
@@ -80,11 +81,14 @@ export function fromJSOrdered(js) {
|
||||
if (Array.isArray(js)) {
|
||||
return Im.Seq(js).map(fromJSOrdered).toList()
|
||||
}
|
||||
if (js.entries) {
|
||||
if (isFunction(js.entries)) {
|
||||
// handle multipart/form-data
|
||||
const objWithHashedKeys = createObjWithHashedKeys(js)
|
||||
return Im.OrderedMap(objWithHashedKeys).map(fromJSOrdered)
|
||||
}
|
||||
if (js.entries && !isFunction(js.entries)) {
|
||||
return Im.OrderedMap(js.entries).map(fromJSOrdered)
|
||||
}
|
||||
return Im.OrderedMap(js).map(fromJSOrdered)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user