mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 09:14:25 +00:00
[TS] Use strict mode in LGraph (#579)
* [TS] Undefined is not a valid object key * Deprecate unused code Adds ts-expect-error to TS strict issues on unmaintained public interfaces. * [TS] Fix nullability: asSerialisable return type * nit - Remove outdated comment * [TS] Strict mode: LGraph - Adds minor coercion changes; would need extremely specific hacks performed to result in runtime change * [TMP] Work around typescript-strict-plugin Must be reverted once plugin removed. See #578
This commit is contained in:
@@ -184,7 +184,7 @@ type ReadOnlyTypedArray<T extends TypedArrays | TypedBigIntArrays> =
|
||||
Omit<T, "fill" | "copyWithin" | "reverse" | "set" | "sort" | "subarray">
|
||||
|
||||
/** Union of property names that are of type Match */
|
||||
export type KeysOfType<T, Match> = { [P in keyof T]: T[P] extends Match ? P : never }[keyof T]
|
||||
export type KeysOfType<T, Match> = Exclude<{ [P in keyof T]: T[P] extends Match ? P : never }[keyof T], undefined>
|
||||
|
||||
/** A new type that contains only the properties of T that are of type Match */
|
||||
export type PickByType<T, Match> = { [P in keyof T]: Extract<T[P], Match> }
|
||||
|
||||
Reference in New Issue
Block a user