diff --git a/csv/_io.ts b/csv/_io.ts index 346818ab7..5ab21b767 100644 --- a/csv/_io.ts +++ b/csv/_io.ts @@ -250,14 +250,13 @@ export type ParseResult = T extends ParseOptions & { columns: readonly (infer C extends string)[] } ? RecordWithColumn[] // If `skipFirstRow` option is specified, the return type is Record type. - : T extends ParseOptions & { skipFirstRow: true } - ? Record[] + : T extends ParseOptions & { skipFirstRow: true } ? Record[] // If `columns` and `skipFirstRow` option is _not_ specified, the return type is string[][]. : T extends ParseOptions & { columns?: undefined; skipFirstRow?: false | undefined } ? string[][] // else, the return type is Record type or string[][]. - : Record[] | string[][]; + : Record[] | string[][]; /** * Record type with column type. @@ -269,5 +268,5 @@ export type ParseResult = * ``` */ export type RecordWithColumn = string extends C - ? Record + ? Record : Record; diff --git a/csv/parse.ts b/csv/parse.ts index bc2bed875..971104e1d 100644 --- a/csv/parse.ts +++ b/csv/parse.ts @@ -388,7 +388,7 @@ export function parse(input: string): string[][]; * const result = parse(string, { skipFirstRow: true }); * * assertEquals(result, [{ a: "d", b: "e", c: "f" }]); - * assertType[]>>(true); + * assertType[]>>(true); * ``` * * @example Specify columns with `columns` option diff --git a/csv/parse_stream.ts b/csv/parse_stream.ts index d0304b895..b643043f6 100644 --- a/csv/parse_stream.ts +++ b/csv/parse_stream.ts @@ -148,7 +148,7 @@ export type RowType = T extends undefined ? string[] * { name: "Alice", age: "34" }, * { name: "Bob", age: "24" }, * ]); - * assertType[]>>(true); + * assertType[]>>(true); * ``` * * @example Specify columns with `columns` option diff --git a/csv/parse_stream_test.ts b/csv/parse_stream_test.ts index 6288ec4ff..21ce2dba5 100644 --- a/csv/parse_stream_test.ts +++ b/csv/parse_stream_test.ts @@ -491,13 +491,13 @@ Deno.test({ // `skipFirstRow` may be `true` or `false`. // `columns` may be `undefined` or `string[]`. // If you don't know exactly what the value of the option is, - // the return type is ReadableStream> + // the return type is ReadableStream> const options: CsvParseStreamOptions = {}; const { readable } = new CsvParseStream(options); type _ = AssertTrue< IsExact< typeof readable, - ReadableStream> + ReadableStream> > >; } @@ -520,7 +520,7 @@ Deno.test({ type _ = AssertTrue< IsExact< typeof readable, - ReadableStream> + ReadableStream> > >; } @@ -541,7 +541,7 @@ Deno.test({ type _ = AssertTrue< IsExact< typeof readable, - ReadableStream> + ReadableStream> > >; } @@ -562,7 +562,7 @@ Deno.test({ type _ = AssertTrue< IsExact< typeof readable, - ReadableStream> + ReadableStream> > >; } diff --git a/csv/parse_test.ts b/csv/parse_test.ts index f5dae7abc..98f63fb2f 100644 --- a/csv/parse_test.ts +++ b/csv/parse_test.ts @@ -943,13 +943,13 @@ Deno.test({ // `skipFirstRow` may be `true` or `false`. // `columns` may be `undefined` or `string[]`. // If you don't know exactly what the value of the option is, - // the return type is string[][] | Record[] + // the return type is string[][] | Record[] const options: ParseOptions = {}; const parsed = parse("a\nb", options); type _ = AssertTrue< IsExact< typeof parsed, - string[][] | Record[] + string[][] | Record[] > >; } @@ -970,7 +970,7 @@ Deno.test({ { const parsed = parse("a\nb", { skipFirstRow: true }); type _ = AssertTrue< - IsExact[]> + IsExact[]> >; } @@ -988,7 +988,7 @@ Deno.test({ { const parsed = parse("a\nb", { columns: ["aaa"] as string[] }); type _ = AssertTrue< - IsExact[]> + IsExact[]> >; } @@ -1000,7 +1000,7 @@ Deno.test({ { const parsed = parse("a\nb", { skipFirstRow: true, columns: undefined }); type _ = AssertTrue< - IsExact[]> + IsExact[]> >; } {