Skip to content

WithoutEmptyIndex ​

Type, in @jr2/orchestrator/src/workspace.ts. The signature of an export, or a type that it names, names this type. The Authoring surface page lists each export. This type is not an export of @jr2/orchestrator, so a workflow module does not import it by name.

ts
type WithoutEmptyIndex<T> = string extends keyof T
  ? [T[string & keyof T]] extends [never]
    ? { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K] }
    : T
  : T;

The fields of the run input T. A string index signature whose value is never is not one of them: z.infer gives Record<string, never> for z.object({}), and this type makes it {}. The named fields of T stay. A different T does not change.

The docs of Kit version 0.5.1. Each page is also at its .md URL.