mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
[nit] Add consistent method chaining linter (#613)
Enforces that chained accessed should **either** all be on one line, or all on individual lines (same as imports).
This commit is contained in:
@@ -2138,8 +2138,7 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
|
||||
|
||||
// Empty string and * match anything (type: 0)
|
||||
if (type == "" || type == "*") type = 0
|
||||
const sourceTypes = String(type).toLowerCase()
|
||||
.split(",")
|
||||
const sourceTypes = String(type).toLowerCase().split(",")
|
||||
|
||||
// Run the search
|
||||
let occupiedSlot: number | TSlot | null = null
|
||||
@@ -2147,8 +2146,7 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
|
||||
const slot: TSlot & IGenericLinkOrLinks = slots[i]
|
||||
const destTypes = slot.type == "0" || slot.type == "*"
|
||||
? ["0"]
|
||||
: String(slot.type).toLowerCase()
|
||||
.split(",")
|
||||
: String(slot.type).toLowerCase().split(",")
|
||||
|
||||
for (const sourceType of sourceTypes) {
|
||||
// TODO: Remove _event_ entirely.
|
||||
|
||||
@@ -100,8 +100,10 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
|
||||
const nextId = this.linkIds.values().next().value
|
||||
return nextId === undefined
|
||||
? undefined
|
||||
: this.#network.deref()
|
||||
?.links.get(nextId)
|
||||
: this.#network
|
||||
.deref()
|
||||
?.links
|
||||
.get(nextId)
|
||||
?.origin_id
|
||||
}
|
||||
|
||||
@@ -110,8 +112,10 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
|
||||
const nextId = this.linkIds.values().next().value
|
||||
return nextId === undefined
|
||||
? undefined
|
||||
: this.#network.deref()
|
||||
?.links.get(nextId)
|
||||
: this.#network
|
||||
.deref()
|
||||
?.links
|
||||
.get(nextId)
|
||||
?.origin_slot
|
||||
}
|
||||
|
||||
@@ -209,7 +213,8 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
|
||||
|
||||
return this.#network
|
||||
.deref()
|
||||
?.reroutes.get(this.#parentId)
|
||||
?.reroutes
|
||||
.get(this.#parentId)
|
||||
?.findNextReroute(withParentId, visited)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user