-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Labels
Description
In v0 of typebox, types were coerced to arrays when possible. In v1, this is no longer is the case.
Would you consider re-adding this to typebox? Otherwise, I would also appreciate if you can give some advice on how to best implement this ourselves.
Context:
This was very convenient for URL search params. We use @fastify/type-provider-typebox.
Previous issue and PR:
#823
#836
Reproduction (runnable as is using deno)
// v1:
import { Type, type Static } from "npm:typebox";
import { Value } from "npm:typebox/value";
// v0:
// import { Type, type Static } from "npm:@sinclair/typebox";
// import { Value } from "npm:@sinclair/typebox/value";
const result = Value.Convert(
Type.Object({
a: Type.Array(Type.String()),
}),
{ a: "string" }
);
console.log("result:", result);PS: Thank you for this awesome library and all the effort you put in. I've been using it and following the progress for years