Which @angular/* package(s) are relevant/related to the feature request?
forms
Description
optional fields can be represented by
the pattern signature is the following and we get a ts(2345) error.
export function pattern<TPathKind extends PathKind = PathKind.Root>(
path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,
pattern: RegExp | LogicFn<string | undefined, RegExp | undefined, TPathKind>,
config?: BaseValidatorConfig<string, TPathKind>,
) {
Proposed solution
export function pattern<TPathKind extends PathKind = PathKind.Root>(
path: SchemaPath<string | null, SchemaPathRules.Supported, TPathKind>,
pattern: RegExp | LogicFn<string | null | undefined, RegExp | undefined, TPathKind>,
config?: BaseValidatorConfig<string | null, TPathKind>,
) {
export function pattern<TValue extends string | null, TPathKind extends PathKind = PathKind.Root>(
path: SchemaPath<TValue , SchemaPathRules.Supported, TPathKind>,
pattern: RegExp | LogicFn<TValue | undefined, RegExp | undefined, TPathKind>,
config?: BaseValidatorConfig<TValue , TPathKind>,
) {
Alternatives considered
Alternative is to just have it as string and use ''
Which @angular/* package(s) are relevant/related to the feature request?
forms
Description
optional fields can be represented by
the pattern signature is the following and we get a ts(2345) error.
Proposed solution
Alternatives considered
Alternative is to just have it as string and use
''