Is there some kind of enumeration library or method I should use or should I write from scratch with recursion?
I'm parsing a JSON tree into an object tree as it happens, and I'd like to replace some nodes with other kinds of objects.
E.g:
db = {'bigBang' :
{'stars':
{'planets': {}, 'is_list':true
}
}
}
db.deepReplace( 'is_list', ['earth', 'mars'] )
>> db is now:
>> {'bigBang' :
>> {'stars':
>> {'planets':
>> {
>> ['earth', 'mars']
>> }
>> }
>> }
>> }