sindresorhus / query-string

Parse and stringify URL query strings
MIT License
6.76k stars 450 forks source link

Optional chaining operator (?.) is not supported in IE and other old browsers #368

Closed lvxiaodi1234 closed 1 year ago

lvxiaodi1234 commented 1 year ago

In error log monitor,I found some errors like "Uncaught SyntaxError: Unexpected token ." from old browsers(IE and so on). image

Debug file "base.js", the problem is optional chaining operator (?.) can not use directly in old browsers

image
sindresorhus commented 1 year ago

From the top of the readme:

For browser usage, this package targets the latest version of Chrome, Firefox, and Safari.

thomasjm commented 1 year ago

Using this operator seems to confuse terser for versions < 5.2.0: https://github.com/terser/terser/issues/567

Some parts of the ecosystem still use an older terser, so I think it would be better not to use the optional chaining operator in libraries.