Only set state.keys when necessary
Only set state.keys when necessary

state.keys is set when (a) a non-primitive value is initially traversed,
(b) a primitive value is replaced with an object or vice-versa.

substack/js-traverse,adjohnson916/js-traverse,h2non/js-traverse,khanh-nguyen/js-traverse,davewasmer/traverse