Remove unused Intl.Segmenter polyfill (#1789)

This commit is contained in:
dan 2023-11-01 16:52:34 +00:00 committed by GitHub
parent 4bf1719092
commit 9fb20517ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 24 deletions

View file

@ -1,5 +1,4 @@
import 'fast-text-encoding'
import Graphemer from 'graphemer'
// @ts-ignore no decl -prf
import findLast from 'array.prototype.findlast'
export {}
@ -54,18 +53,3 @@ globalThis.atob = (str: string): string => {
}
return result
}
const splitter = new Graphemer()
globalThis.Intl = globalThis.Intl || {}
// @ts-ignore we're polyfilling -prf
globalThis.Intl.Segmenter =
// @ts-ignore we're polyfilling -prf
globalThis.Intl.Segmenter ||
class Segmenter {
constructor() {}
// NOTE
// this is not a precisely correct polyfill but it's sufficient for our needs
// -prf
segment = splitter.iterateGraphemes
}