-
Notifications
You must be signed in to change notification settings - Fork 45
Numeric-key objects result in sparse arrays #66
Copy link
Copy link
Open
Description
Reading through some of the other issues, it seems this may be intended behavior. We have enabled the option to output brackets around array indices.
{
items: [
{
123: 'foo',
456: 'bar'
}
]
}
// dot.dot(obj)
{
'items[0].123': 'foo',
'items[0].456': 'bar'
}
But when you run that through dot.object(), you don't get the original object. You get a sparse array instead.
{
items: [
[
...123 empty slots...
'foo',
...333 empty slots...
'bar'
]
]
}
Is there an option to use objects for . in all cases, even when the key is an integer?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels