mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
feat: upgrade libraries for dependabot alerts (#3300)
* feat: upgrade libraries and code cleanup
This commit is contained in:
24
packages/bruno-app/src/utils/common/setupPolyfills.js
Normal file
24
packages/bruno-app/src/utils/common/setupPolyfills.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export const setupPolyfills = () => {
|
||||
// polyfill required to make react-pdf
|
||||
if (typeof Promise.withResolvers === "undefined") {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.Promise.withResolvers = function () {
|
||||
let resolve, reject
|
||||
const promise = new Promise((res, rej) => {
|
||||
resolve = res
|
||||
reject = rej
|
||||
})
|
||||
return { promise, resolve, reject }
|
||||
}
|
||||
} else {
|
||||
global.Promise.withResolvers = function () {
|
||||
let resolve, reject
|
||||
const promise = new Promise((res, rej) => {
|
||||
resolve = res
|
||||
reject = rej
|
||||
})
|
||||
return { promise, resolve, reject }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user