browserslist-useragent
browserslist-useragent copied to clipboard
Add createUAMatcher to reuse configured browserslist
We were using matchUA
inside an express.js middleware and found that
it was quite expensive to create the browserslist for every request.
This changes introduces a new export createUAMatcher
that can be used
to return an already configured matchUA
function for a given
browserslist.
This improves performance when checking multiple user-agent strings against the same browserslist.
Co-authored-by: Robin Drexler [email protected]
@pastelsky have you had a chance to look over this yet? What are your thoughts?
@ZauberNerd It would be great if you can share the results of the performance analysis that was done.