Merge remote-tracking branch 'origin/parse-performance'

This commit is contained in:
barsdeveloper
2023-03-02 19:44:53 +01:00
17 changed files with 5037 additions and 4905 deletions

View File

@@ -293,17 +293,21 @@ export default class Utility {
}
/** @param {String} value */
static escapeString(value, input = false) {
static escapeString(value) {
return value
.replaceAll('\\', '\\\\') // Escape \
.replaceAll('"', '\\"') // Escape "
.replaceAll("\n", "\\n") // Replace newline with \n
.replaceAll("\t", "\\t") // Replace tab with \t
}
/** @param {String} value */
static unescapeString(value, input = false) {
static unescapeString(value) {
return value
.replaceAll('\\"', '"')
.replaceAll("\\n", "\n")
.replaceAll("\\t", "\t") // Replace tab with \t
.replaceAll("\\n", "\n") // Replace newline with \n
.replaceAll('\\"', '"') // Escape "
.replaceAll('\\\\', '\\') // Escape \
}
/** @param {String} value */