Skip to content

Improve typing of text-format - #102

Open
bristermitten wants to merge 4 commits into
jhipster:mainfrom
bristermitten:main
Open

bristermitten wants to merge 4 commits into
jhipster:mainfrom
bristermitten:main

Conversation

@bristermitten

Copy link
Copy Markdown

Slightly improves the typing of the TextFormat component so that the allowed value types depend on the type field:
when type: "number", only string | number is allowed, and when type: "date", any dayjs.ConfigType is allowed (string | number | Date | Dayjs)

This improves type safety, preventing common errors but also allowing the Dayjs type to be passed as an argument, which previously created a type error

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant