754663e5c3
* Add findlast shim for crappy browsers * Fix types
22 lines
839 B
TypeScript
22 lines
839 B
TypeScript
// @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)
|
|
|
|
// @ts-ignore not on the TS signature due to bad support -prf
|
|
if (!globalThis.Intl?.Segmenter) {
|
|
// NOTE loading as a separate script to reduce main bundle size, as this is only needed in FF -prf
|
|
const script = document.createElement('script')
|
|
script.setAttribute('src', '/static/js/intl-segmenter-polyfill.min.js')
|
|
document.head.appendChild(script)
|
|
|
|
// loading emoji mart data
|
|
const emojiMartScript = document.createElement('script')
|
|
emojiMartScript.setAttribute('src', '/static/js/emoji-mart-data.js')
|
|
document.head.appendChild(emojiMartScript)
|
|
}
|