RecordWithColumn

import { RecordWithColumn } from "jsr:@ende/csv";

type alias

type RecordWithColumn<C extends string> = string extends C ? Record<string, string> : Record<C, string>

Record type with column type.

Example

type RecordWithColumn<"aaa"|"bbb"> => Record<"aaa"|"bbb", string>
type RecordWithColumn<string> => Record<string, string | undefined>

Source