polyfill-ua
Check whether a user agent requires a polyfill. Designed to be used with user-agent based polyfills.
You compile objects of browsers and versions,
which denote the minimum version a feature requires.
The compiled function returns true
if a polyfill is required for that browser.
var browsers = chrome: true // supported on all versions of chrome ie: false // not supported on any version of chrome, safari: 7 // supported on safari 7+. numbers are prefixed with `>= ` ff: '>= 1.5.3' // supported on ff `1.5.3`. strings __must be semver ranges__; var polyfill = ; ; // => false because no polyfill is needed ; // => true because a polyfill is needed
You can also compile functions from caniuse-db
!
var polyfill = ; ; // false because you don't need a polyfill! ; // true because you need a polyfill!