to-json: Would be fab if we could specify a sort-comparator for the keys, so that we could control the ordering of the keys in the output.
Given that keys can be multi-level, maybe make $a/$b strings contain the delimited parts of the parent keys - e.g. $a = "one\tgreen\tapple" means that this value is at "one": { "green" : "apple", ... etc. etc. depending on the internals.
This means that I could sort keys according to an arbitrary external priority - like whether an entry in my META6.json is required or optional, or I could even remember incoming JSON key order and write new JSON in the same order with new entries at the end - etc. etc.
to-json: Would be fab if we could specify a sort-comparator for the keys, so that we could control the ordering of the keys in the output.
Given that keys can be multi-level, maybe make $a/$b strings contain the delimited parts of the parent keys - e.g.
$a = "one\tgreen\tapple"
means that this value is at"one": { "green" : "apple", ..
. etc. etc. depending on the internals.This means that I could sort keys according to an arbitrary external priority - like whether an entry in my META6.json is required or optional, or I could even remember incoming JSON key order and write new JSON in the same order with new entries at the end - etc. etc.