Skip to content

Commit 70c7be7

Browse files
authored
export polyfills object, and baseSupport var
1 parent 12b34e6 commit 70c7be7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as promiseAny from './promise-any.js'
1111
import * as requestIdleCallback from './requestidlecallback.js'
1212
import * as stringReplaceAll from './string-replaceall.js'
1313

14-
const baseSupport =
14+
export const baseSupport =
1515
typeof Blob === 'function' &&
1616
typeof PerformanceObserver === 'function' &&
1717
typeof Intl === 'object' &&
@@ -44,7 +44,7 @@ const baseSupport =
4444
// 'at' in Array.prototype && // Polyfilled
4545
true
4646

47-
const polyfills = [
47+
export const polyfills = {
4848
abortSignalAbort,
4949
abortSignalTimeout,
5050
aggregateError,
@@ -57,25 +57,25 @@ const polyfills = [
5757
promiseAny,
5858
requestIdleCallback,
5959
stringReplaceAll
60-
]
60+
}
6161

6262
export function isSupported() {
6363
return (
6464
baseSupport &&
65-
polyfills.every(polyfill => {
65+
Object.values(polyfills).every(polyfill => {
6666
polyfill.isSupported()
6767
})
6868
)
6969
}
7070

7171
export function isPolyfilled() {
72-
return polyfills.every(polyfill => {
72+
return Object.values(polyfills).every(polyfill => {
7373
polyfill.isPolyfilled()
7474
})
7575
}
7676

7777
export function apply() {
78-
for (const polyfill of polyfills) {
78+
for (const polyfill of Object.values(polyfills)) {
7979
polyfill.apply()
8080
}
8181
}

0 commit comments

Comments
 (0)