mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-21 14:59:39 +00:00
[Refactor] Standardise code style - modern JS (#636)
Uses unicorn rules to auto-refactor code. All verified.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user