added chainable functions in em()

This commit is contained in:
dswbx
2024-12-19 16:12:30 +01:00
parent d7ee13011f
commit a7e3ce878a
5 changed files with 82 additions and 28 deletions

View File

@@ -104,6 +104,12 @@ export class TextField<Required extends true | false = false> extends Field<
);
}
if (this.config.pattern && value && !new RegExp(this.config.pattern).test(value)) {
throw new TransformPersistFailedException(
`Field "${this.name}" must match the pattern ${this.config.pattern}`
);
}
return value;
}