Pass a defaults array as the first argument so the template can be validated directly — without calling .apply(). The template function is called once with the defaults and the result is cached.
const result = schema.validate(data)Define a schema to see its inferred TypeScript type.
InferType<typeof schema> automatically derives the TypeScript type from your schema definition.