@paraboly/pwc-multi-filter
Version:
A wrapper over pwc-tabview and pwc-filter. Provides means of dynamically managing multiple filters via a single component.
36 lines (31 loc) • 1.04 kB
JavaScript
export function applyPolyfills() {
if (typeof window !== 'undefined') {
var win = window;
var promises = [];
if (!win.customElements || (win.Element && (!win.Element.prototype.closest || !win.Element.prototype.matches || !win.Element.prototype.remove))) {
promises.push(import('./dom.js'));
}
function checkIfURLIsSupported() {
try {
var u = new URL('b', 'http://a');
u.pathname = 'c%20d';
return (u.href === 'http://a/c%20d') && u.searchParams;
} catch (e) {
return false;
}
}
if (
'function' !== typeof Object.assign || !Object.entries ||
!Array.prototype.find || !Array.prototype.includes ||
!String.prototype.startsWith || !String.prototype.endsWith ||
(win.NodeList && !win.NodeList.prototype.forEach) ||
!win.fetch ||
!checkIfURLIsSupported() ||
typeof WeakMap == 'undefined'
) {
promises.push(import('./core-js.js'));
}
return Promise.all(promises);
}
return Promise.resolve();
}