type("string[]") // this type is not always the same, can be regex, etc...
.or("undefined")
.pipe((v) => v ?? [])
.narrow(
(v, ctx) =>
new Set(v).size === v.length ||
ctx.mustBe("array with unique elements"),
)
type("string[]") // this type is not always the same, can be regex, etc...
.or("undefined")
.pipe((v) => v ?? [])
.narrow(
(v, ctx) =>
new Set(v).size === v.length ||
ctx.mustBe("array with unique elements"),
)