expand arrays
Is there a way to
expandObject
except for an Array?8 Replies
My Form Data
Desired output:
I'm interested in hearing less messy solutions, but this seems to work:
There's no way to identify arrays in that, so there probably are no good methods.
I thought the foundry default expand object does this
At least when my form data has keys with 0s and such like that it shows up as arrays
It looks like this for me:
well that works with
getProperty
just fine asfik even if the underlying data looks sillyI need it to be an actual array because I need it to work with the Array push/pop/filter/unshift/etc. methods
Ah just do
Object.values()
recursively for the ones you know are arrays then.
which is what you're doing soOhhhh that's what I did now I remember
@arcanistzed there's a method you can override in formapplication that isn't
_updateObject
which manipulates the form values provided to updateObject: _getSubmitData
so i'd recommend doing whatever you come up with in there