We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3de4239 + aaa4fa8 commit 576275eCopy full SHA for 576275e
src/utils/get-form-value.js
@@ -1,4 +1,5 @@
1
import mapValues from './map-values';
2
+import toArray from './to-array';
3
4
export default function getFormValue(form) {
5
if (form && !form.$form) {
@@ -15,5 +16,7 @@ export default function getFormValue(form) {
15
16
17
delete result.$form;
18
- return result;
19
+ const isArray = form && form.$form && Array.isArray(form.$form.value);
20
+
21
+ return isArray ? toArray(result) : result;
22
}
src/utils/to-array.js
@@ -0,0 +1,9 @@
+export default function toArray(object) {
+ const result = [];
+ Object.keys(object).forEach(key => {
+ if (object.hasOwnProperty(key)) {
+ result.push(object[key]);
6
+ }
7
+ });
8
+ return result;
9
+}
0 commit comments