I'll admit I'm having trouble imagining a use case for this but I must ask:
What happens with arrays?
What happens with deeply nested objects?
Also if you don't mind me asking what case might you want something like this where you don't seem to care about the context of the key and value (i.e. top level key and top level value version deeply nested key of, potentially, the same name.)?