Skip to content

Commit b81febb

Browse files
fix: exclude arrays from DeepPartial recursion
DeepPartial<string[]> was producing (string | undefined)[] instead of string[], breaking type compatibility with generated RPC types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0b51a4d commit b81febb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

nodejs/src/types.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,8 +1469,12 @@ export interface ModelCapabilities {
14691469
};
14701470
}
14711471

1472-
/** Recursively makes all properties optional. */
1473-
type DeepPartial<T> = T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
1472+
/** Recursively makes all properties optional, preserving arrays as-is. */
1473+
type DeepPartial<T> = T extends readonly (infer U)[]
1474+
? DeepPartial<U>[]
1475+
: T extends object
1476+
? { [K in keyof T]?: DeepPartial<T[K]> }
1477+
: T;
14741478

14751479
/** Deep-partial override for model capabilities — every property at any depth is optional. */
14761480
export type ModelCapabilitiesOverride = DeepPartial<ModelCapabilities>;

0 commit comments

Comments
 (0)