refactor(codemode): split runtime into focused interpreter modules (#36540)

This commit is contained in:
Aiden Cline 2026-07-12 12:47:56 -05:00 committed by GitHub
commit 49cb73b348
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1911 additions and 2277 deletions

View file

@ -23,8 +23,7 @@ const asArray = (value: unknown): ReadonlyArray<unknown> => (Array.isArray(value
export const nonEmptyString = (value: unknown): string | undefined =>
typeof value === "string" && value !== "" ? value : undefined
// Guards record lookups keyed by spec- or model-controlled names against
// prototype-inherited values (e.g. a parameter named `toString`).
// Spec- and model-controlled keys must not resolve inherited properties.
export const own = <T>(record: Readonly<Record<string, T>>, key: string): T | undefined =>
Object.hasOwn(record, key) ? record[key] : undefined
@ -106,7 +105,7 @@ const operationParameters = (
pathItem: Record<string, unknown>,
operation: Record<string, unknown>,
): Parsed<ReadonlyArray<PlannedField>> => {
// Operation-level parameters override path-level ones sharing (location, name).
// OpenAPI operation parameters override path parameters with the same location and name.
const declared = new Map<
string,
{ readonly name: string; readonly location: string; readonly parameter: Record<string, unknown> }