Open
Description
I just want to parse a specific value from a string using RegExp. This works, but TS complains about types.
import * as v from 'valibot';
const Schema = v.pipe(
v.string(),
// correct string - 2024.01.30
v.transform(value => /^(\d{4})\.\d{2}\.\d{2}$/.exec(value)),
v.array(v.string()),
v.length(2),
v.transform(value => Number(value[1])),
);
const result = v.safeParse(Schema, '2024.01.30');
console.log(result);