Skip to content
This repository has been archived by the owner on Mar 5, 2018. It is now read-only.

Generated path does not handle object keys requiring bracket notation #2

Closed
whitlockjc opened this issue Jun 26, 2014 · 1 comment
Closed

Comments

@whitlockjc
Copy link

Whenever a path is generated and jjve blindly assumes that non-array values can be accessed using dot notation. jjve.js#L245 It would be great to use bracket notation for property names that are not valid for use with dot notation. For example, $.models.Order Stuff.description should be $.models['Order Stuff'].description.

@whitlockjc
Copy link
Author

Have you looked at substackjs-/traverse? It computes paths as an array of numbers/strings. Maybe a structure like that would make more sense because you wouldn't need to parse the path string to figure out how to get at the particular object path. So instead of $.models.Order.description you'd have ['models', 'Order', 'description']. I think some way to reuse the path to find the offending object path would be great.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant