remove patches

This commit is contained in:
SrGooglo 2025-03-13 23:37:03 +00:00
parent 25d82a12d8
commit 8576954187
2 changed files with 0 additions and 55 deletions

View File

@ -1,5 +1,3 @@
import "./patches"
import React from "react"
import { Runtime } from "@ragestudio/vessel"
import { Helmet } from "react-helmet"

View File

@ -1,53 +0,0 @@
// Patch global prototypes
import { Buffer } from "buffer"
globalThis.IS_MOBILE_HOST = window.navigator.userAgent === "capacitor"
window.Buffer = Buffer
Array.prototype.findAndUpdateObject = function (discriminator, obj) {
let index = this.findIndex(item => item[discriminator] === obj[discriminator])
if (index !== -1) {
this[index] = obj
}
return index
}
Array.prototype.move = function (from, to) {
this.splice(to, 0, this.splice(from, 1)[0])
return this
}
String.prototype.toTitleCase = function () {
return this.replace(/\w\S*/g, function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
})
}
String.prototype.toBoolean = function () {
return this === "true"
}
Promise.tasked = function (promises) {
return new Promise(async (resolve, reject) => {
let rejected = false
for await (let promise of promises) {
if (rejected) {
return
}
try {
await promise()
} catch (error) {
rejected = true
return reject(error)
}
}
if (!rejected) {
return resolve()
}
})
}