Skip to content

Commit

Permalink
Ignore biome error
Browse files Browse the repository at this point in the history
  • Loading branch information
naru200 committed Nov 11, 2024
1 parent 2e35ff5 commit 2cbced9
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions website/src/utils/polyfilsResolver.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
if (typeof Promise.withResolvers === "undefined") {
if (typeof window !== "undefined") {
// @ts-expect-error This does not exist outside of polyfill which this is doing
window.Promise.withResolvers = function () {
let resolve, reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject };
};
} else {
// @ts-expect-error This does not exist outside of polyfill which this is doing
global.Promise.withResolvers = function () {
let resolve, reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject };
};
}
if (typeof window !== "undefined") {
// @ts-expect-error This does not exist outside of polyfill which this is doing
window.Promise.withResolvers = () => {
// biome-ignore lint/suspicious/noImplicitAnyLet: <explanation>
// biome-ignore lint/style/useSingleVarDeclarator: <explanation>
let resolve, reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject };
};
} else {
// @ts-expect-error This does not exist outside of polyfill which this is doing
global.Promise.withResolvers = () => {
// biome-ignore lint/suspicious/noImplicitAnyLet: <explanation>
// biome-ignore lint/style/useSingleVarDeclarator: <explanation>
let resolve, reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject };
};
}
}

0 comments on commit 2cbced9

Please sign in to comment.