[Refactor] Fix TS types, remove redundant code (#648)

Minor clean up and graph null deref checks.

Minor runtime change: due to optional chaining, it is possible a
downstream consumer is catching this extremely rare behaviour on purpose
and handling it.
This commit is contained in:
filtered
2025-02-28 22:13:23 +11:00
committed by GitHub
parent 4365873039
commit b877312336
3 changed files with 37 additions and 28 deletions

View File

@@ -492,7 +492,7 @@ export class LiteGraphGlobal {
* @param category category name
* @returns array with all the node classes
*/
getNodeTypesInCategory(category: string, filter: any) {
getNodeTypesInCategory(category: string, filter?: string) {
const r = []
for (const i in this.registered_node_types) {
const type = this.registered_node_types[i]
@@ -513,7 +513,7 @@ export class LiteGraphGlobal {
* @param filter only nodes with ctor.filter equal can be shown
* @returns array with all the names of the categories
*/
getNodeTypesCategories(filter: string): string[] {
getNodeTypesCategories(filter?: string): string[] {
const categories: Dictionary<number> = { "": 1 }
for (const i in this.registered_node_types) {
const type = this.registered_node_types[i]