Skip to content

Improve typing of text-format#102

Open
bristermitten wants to merge 4 commits intojhipster:mainfrom
bristermitten:main
Open

Improve typing of text-format#102
bristermitten wants to merge 4 commits intojhipster:mainfrom
bristermitten:main

Conversation

@bristermitten
Copy link

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

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