sindresorhus / ow

Function argument validation for humans
https://sindresorhus.com/ow/
MIT License
3.81k stars 108 forks source link

Fix performance issues and cleanup code #199

Closed vladfrangu closed 3 years ago

vladfrangu commented 3 years ago

As shown in #193, turns out, creating the stack trace needlessly is very, very taxing performance wise. With this PR, that is only done IF we're in a browser environment without Error.captureStackTrace.

Also, changes some string arrays to sets, as it helps keep code cleaner and removes some if checks

sindresorhus commented 3 years ago

Can you fix the merge conflict?

vladfrangu commented 3 years ago

Done @sindresorhus!

sindresorhus commented 3 years ago

Thanks :)