Skip to content

Commit 78aeb4e

Browse files
authored
Merge pull request #51 from keithamus/remove-a-whole-bunch-of-polyfills
Remove a whole bunch of polyfills
2 parents 58753f3 + bc9b816 commit 78aeb4e

18 files changed

+140
-880
lines changed

docs/index.html

+130-340
Large diffs are not rendered by default.

src/abortsignal-abort.ts

-27
This file was deleted.

src/array-findlast.ts

-26
This file was deleted.

src/array-findlastindex.ts

-31
This file was deleted.

src/arraylike-at.ts

-40
This file was deleted.

src/crypto-randomuuid.ts

-33
This file was deleted.

src/event-abortsignal.ts

-48
This file was deleted.

src/form-requestsubmit.ts

-32
This file was deleted.

src/index.ts

+10-37
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,11 @@
1-
import * as abortSignalAbort from './abortsignal-abort.js'
21
import * as abortSignalTimeout from './abortsignal-timeout.js'
3-
import * as arrayAt from './arraylike-at.js'
42
import * as clipboardItem from './clipboarditem.js'
5-
import * as cryptoRandomUUID from './crypto-randomuuid.js'
63
import * as elementCheckVisibility from './element-checkvisibility.js'
7-
import * as eventAbortSignal from './event-abortsignal.js'
84
import * as navigatorClipboard from './navigator-clipboard.js'
9-
import * as formRequestSubmit from './form-requestsubmit.js'
10-
import * as objectHasOwn from './object-hasown.js'
115
import * as requestIdleCallback from './requestidlecallback.js'
12-
import * as arrayFindLast from './array-findlast.js'
13-
import * as arrayFindLastIndex from './array-findlastindex.js'
146

157
export const baseSupport =
16-
typeof Blob === 'function' &&
17-
typeof PerformanceObserver === 'function' &&
18-
typeof Intl === 'object' &&
19-
typeof MutationObserver === 'function' &&
20-
typeof URLSearchParams === 'function' &&
21-
typeof WebSocket === 'function' &&
22-
typeof IntersectionObserver === 'function' &&
23-
typeof queueMicrotask === 'function' &&
24-
typeof TextEncoder === 'function' &&
25-
typeof TextDecoder === 'function' &&
26-
typeof customElements === 'object' &&
27-
typeof HTMLDetailsElement === 'function' &&
28-
typeof AbortController === 'function' &&
29-
typeof AbortSignal === 'function' &&
308
typeof globalThis === 'object' &&
31-
'entries' in FormData.prototype &&
32-
'toggleAttribute' in Element.prototype &&
339
// ES2019
3410
'fromEntries' in Object &&
3511
'flatMap' in Array.prototype &&
@@ -41,32 +17,29 @@ export const baseSupport =
4117
'replaceAll' in String.prototype &&
4218
'any' in Promise &&
4319
// ES2022
44-
// 'at' in String.prototype && // Polyfilled
45-
// 'at' in Array.prototype && // Polyfilled
46-
// 'hasOwn' in Object && // Polyfilled
20+
'at' in String.prototype &&
21+
'at' in Array.prototype &&
22+
'hasOwn' in Object &&
4723
// ESNext
48-
// 'abort' in AbortSignal && // Polyfilled
24+
'abort' in AbortSignal &&
4925
// 'timeout' in AbortSignal && // Polyfilled
26+
// DOM / HTML and other specs
27+
typeof queueMicrotask === 'function' &&
28+
typeof HTMLDialogElement === 'function' &&
5029
typeof AggregateError === 'function' &&
51-
// 'randomUUID' in crypto && // Polyfilled
30+
typeof BroadcastChannel === 'function' &&
31+
'randomUUID' in crypto &&
5232
'replaceChildren' in Element.prototype &&
33+
'requestSubmit' in HTMLFormElement.prototype &&
5334
// 'requestIdleCallback' in window && // Polyfilled
5435
true
5536

5637
export const polyfills = {
57-
abortSignalAbort,
5838
abortSignalTimeout,
59-
arrayAt,
6039
clipboardItem,
61-
cryptoRandomUUID,
6240
elementCheckVisibility,
63-
eventAbortSignal,
6441
navigatorClipboard,
65-
formRequestSubmit,
66-
objectHasOwn,
6742
requestIdleCallback,
68-
arrayFindLast,
69-
arrayFindLastIndex,
7043
}
7144

7245
export function isSupported() {

src/object-hasown.ts

-33
This file was deleted.

test/abortsignal-abort.js

-24
This file was deleted.

0 commit comments

Comments
 (0)