mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-05-10 20:50:46 +00:00
fix: promise withresolvers polyfill
This commit is contained in:
parent
f6297e8be3
commit
2cd4764cbd
2 changed files with 13 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ui",
|
"name": "ui",
|
||||||
"version": "6.4.62",
|
"version": "6.4.63",
|
||||||
"license": "BUSL-1.1",
|
"license": "BUSL-1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.15.5",
|
"packageManager": "pnpm@9.15.5",
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,15 @@ import '$lib'
|
||||||
export const ssr = false
|
export const ssr = false
|
||||||
export const prerender = false
|
export const prerender = false
|
||||||
export const trailingSlash = 'always'
|
export const trailingSlash = 'always'
|
||||||
|
|
||||||
|
if (typeof Promise.withResolvers === 'undefined') {
|
||||||
|
Promise.withResolvers = function <T> () {
|
||||||
|
let resolve: (value: T | PromiseLike<T>) => void
|
||||||
|
let reject: (reason?: unknown) => void
|
||||||
|
const promise = new Promise<T>((_resolve, _reject) => {
|
||||||
|
resolve = _resolve
|
||||||
|
reject = _reject
|
||||||
|
})
|
||||||
|
return { promise, resolve: resolve!, reject: reject! }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue