[Refactor] Standardise code style - modern JS (#636)

Uses unicorn rules to auto-refactor code.  All verified.
This commit is contained in:
filtered
2025-02-28 00:13:32 +11:00
committed by GitHub
parent 6737828a2b
commit 97bf9de83a
8 changed files with 50 additions and 70 deletions

View File

@@ -72,7 +72,7 @@ export class LiteGraphGlobal {
CONNECTING_LINK_COLOR = "#AFA"
/** avoid infinite loops */
MAX_NUMBER_OF_NODES = 10000
MAX_NUMBER_OF_NODES = 10_000
/** default node position */
DEFAULT_POSITION = [100, 100]
/** ,"circle" */
@@ -297,7 +297,7 @@ export class LiteGraphGlobal {
}
} else {
this.getTime = function () {
return new Date().getTime()
return Date.now()
}
}
}
@@ -446,8 +446,8 @@ export class LiteGraphGlobal {
if (this.catch_exceptions) {
try {
node = new base_class(title)
} catch (err) {
console.error(err)
} catch (error) {
console.error(error)
return null
}
} else {
@@ -554,8 +554,8 @@ export class LiteGraphGlobal {
dynamicScript.src = src
docHeadObj.append(dynamicScript)
script_file.remove()
} catch (err) {
if (this.throw_errors) throw err
} catch (error) {
if (this.throw_errors) throw error
if (this.debug) console.log("Error while reloading " + src)
}
}