recurses over a js object to determine it's complex key and then sets that key to the leaf value