Closed Barbarrosa closed 3 years ago
I was also double checking specs and adding a test({1: true})
just to be sure that it worked as before. I also put it into some of our benchmark to see and as expected it didn't really change because we rarely decode a whole object. Anyway this is a nice change.
JavaScript only allows strings and symbols for object keys, and this lib doesn't support symbols. That leaves only strings, so we can assume that all encoded keys are strings and trigger a failure if they aren't strings. We can also skip all additional type checks.
This change measurably improved performance in my tests.