mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-01-12 02:21:49 +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",
|
||||
"version": "6.4.62",
|
||||
"version": "6.4.63",
|
||||
"license": "BUSL-1.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.15.5",
|
||||
|
|
|
|||
|
|
@ -3,3 +3,15 @@ import '$lib'
|
|||
export const ssr = false
|
||||
export const prerender = false
|
||||
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