I'm trying to build a generic input component, where custom patterns are optional. However, if I pass an empty object, my input gets stuck. I also can't set patterns=undefined because TS will throw a type mismatch error. Currently, I just copied the library patterns and set them as a default.
Are there any better solutions?
<input
[mask]="options.mask"
[patterns]="options.customPatterns ?? {}"
/>