Skip to content

Commit

Permalink
fix: Parenthesize inner type of array
Browse files Browse the repository at this point in the history
  • Loading branch information
eliassjogreen committed Sep 3, 2024
1 parent f82d5ee commit c6f491e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@denosaurs/typefetch",
"version": "0.0.11",
"version": "0.0.12",
"exports": {
".": "./main.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function toSchemaType(
}
case "array": {
const items = toSchemaType(document, schema.items);
if (items !== undefined) return `${items}[]`;
if (items !== undefined) return `(${items})[]`;
return "unknown[]";
}
case "null":
Expand Down
2 changes: 1 addition & 1 deletion types/urlsearchparams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type MayInclude<T extends string, R extends readonly string[] = []> = R | { [K i
* @example MustInclude<"a" | "b"> = ["a", "b"] | ["b", "a"]
* @example MustInclude<"a" | "b" | "c"> = ["a", "b", "c"] | ["a", "c", "b"] | ["b", "a", "c"] | ["b", "c", "a"] | ["c", "a", "b"] | ["c", "b", "a"]
*/
type MustInclude<T extends string> = { [K in T]: Exclude<T, K> extends never ? [K] : [K, ...MustInclude<Exclude<T, K>>] }[T];
type MustInclude<T extends string> = { [K in T]: [Exclude<T, K>] extends [never] ? [K] : [K, ...MustInclude<Exclude<T, K>>] }[T];

/**
* Extracts all required search params as a union of `URLSearchParamsKeyValue`
Expand Down

0 comments on commit c6f491e

Please sign in to comment.