dot-object icon indicating copy to clipboard operation
dot-object copied to clipboard

Converted array turns into object

Open evancarey opened this issue 8 years ago • 0 comments

Was hoping I'd get back what I started with...

var a = [{'id':'xxx'}]; console.log(dot.object(dot.dot(a)));

Object { 0: Object { id: 'xxx' } }

I understand when dot.object() is called it knows nothing about the argument passed to dot.dot() and assuming properties are actually array indices just because they're ints might be problematic. But, if they're all ints and contiguous maybe it'd be a safe assumption?

https://codepen.io/ecarey/pen/owJLJO

Kudos on the library by the way. I appreciate your work.

evancarey avatar Jul 11 '17 23:07 evancarey