diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-09-15 14:40:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-15 14:40:15 -0700 |
commit | 754663e5c33b2179e460537e320d03386de3134f (patch) | |
tree | f9e29783488925be594771671507207ec8bfb213 /src | |
parent | 0672451ddca4c3496e8bfc1746289b7ce3d9ede2 (diff) | |
download | voidsky-754663e5c33b2179e460537e320d03386de3134f.tar.zst |
Add findlast shim for outdated browsers (#1463)
* Add findlast shim for crappy browsers * Fix types
Diffstat (limited to 'src')
-rw-r--r-- | src/platform/polyfills.ts | 4 | ||||
-rw-r--r-- | src/platform/polyfills.web.ts | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/platform/polyfills.ts b/src/platform/polyfills.ts index d5028c294..c26c864ca 100644 --- a/src/platform/polyfills.ts +++ b/src/platform/polyfills.ts @@ -1,7 +1,11 @@ import 'fast-text-encoding' import Graphemer from 'graphemer' +// @ts-ignore no decl -prf +import findLast from 'array.prototype.findlast' export {} +findLast.shim() + /** https://github.com/MaxArt2501/base64-js The MIT License (MIT) diff --git a/src/platform/polyfills.web.ts b/src/platform/polyfills.web.ts index 1f9a3fa5e..1df661d70 100644 --- a/src/platform/polyfills.web.ts +++ b/src/platform/polyfills.web.ts @@ -1,5 +1,9 @@ +// @ts-ignore no decl -prf +import * as findLast from 'array.prototype.findlast' /// <reference lib="dom" /> +findLast.shim() + // @ts-ignore whatever typescript wants to complain about here, I dont care about -prf window.setImmediate = (cb: () => void) => setTimeout(cb, 0) |