Ability to parse objects in addition to JSON #6

Closed
3rd-Eden opened this Issue Jul 17, 2012 · 4 comments

Projects

None yet

2 participants

@3rd-Eden
Collaborator

As most of my configuration objects are plain JavaScript object's that are required using require('file.json') which already parses the content to JSON.

@tj
Owner
tj commented Jul 17, 2012

+1, I use .read() but ya i agree there's no good reason we shouldn't be able to pass an object to .parse(), though it currently works off of the JSON.parse reviver function

@3rd-Eden
Collaborator

I'm currently just doing a JSON.stringify on my object and send it to eson. Which isn't the most pretty way of doing things, but it get the job done.

Parsing objects wouldn't be to hard to add, as long we don't hit any recursion.

@tj
Owner
tj commented Jul 17, 2012

for now we could just .stringify in .parse() so it's at least encapsulated and then if we need better perf fix it later. I only use it for config files right now so that part definitely doesn't matter to me ATM

@3rd-Eden
Collaborator

I'll prepare a pull request and some tests for it

@3rd-Eden 3rd-Eden referenced this issue Jul 17, 2012
Merged

Parse objects #7

@tj tj closed this in 8db75ed Jul 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment