[TS] Use strict mode in LGraphGroup (#599)

- Adds `NullGraphError` to reduce boilerplate null check code
- Prefer optional `undefined` to explicit `null`
  - Related: https://github.com/Comfy-Org/litegraph.js/issues/595
- Adds strict types
This commit is contained in:
filtered
2025-02-26 04:15:48 +11:00
committed by GitHub
parent 477d498d6b
commit 0b84ca83d8
3 changed files with 13 additions and 3 deletions

View File

@@ -0,0 +1,6 @@
export class NullGraphError extends Error {
constructor(message: string = "Attempted to access LGraph reference that was null or undefined.", cause?: Error) {
super(message, { cause })
this.name = "NullGraphError"
}
}