bv-ui-core
Advanced tools
Comparing version
# Polyfills! | ||
The polyfills contained in this folder can be imported as necessary. They should | ||
export either the built-in being polyfilled, if found on the global, or the | ||
polyfill. | ||
export either the builtin native function(s), if found on the global, or the | ||
polyfill itself. | ||
@@ -17,2 +17,12 @@ ## Usage | ||
```js | ||
const { fetch, Headers } = require('bv-ui-core/lib/polyfills/fetch') | ||
// Do things with the fetch polyfill! | ||
fetch(url, { | ||
headers: new Headers({ | ||
'Accept': 'application/json', | ||
}), | ||
}).then(myCallback) | ||
``` | ||
**In webpack** | ||
@@ -22,8 +32,10 @@ | ||
plugins: [ | ||
// Any references to these items in the bundle will be wrapped in | ||
// references to their respective polyfill module exports. | ||
new webpack.ProvidePlugin({ | ||
// Any Promise references in the bundle will be wrapped in references to | ||
// the polyfill. | ||
Promise: 'bv-ui-core/lib/polyfill/promise' | ||
Promise: 'bv-ui-core/lib/polyfill/promise', | ||
fetch: ['bv-ui-core/lib/polyfill/fetch', 'fetch'], | ||
Headers: ['bv-ui-core/lib/polyfill/fetch', 'Headers'], | ||
}) | ||
] | ||
``` |
{ | ||
"name": "bv-ui-core", | ||
"version": "0.14.1", | ||
"version": "0.14.2", | ||
"license": "Apache 2.0", | ||
@@ -53,3 +53,6 @@ "description": "Bazaarvoice UI-related JavaScript", | ||
} | ||
}, | ||
"dependencies": { | ||
"whatwg-fetch": "^2.0.3" | ||
} | ||
} |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
201694
2.83%94
3.3%4716
2.7%1
Infinity%+ Added
+ Added