Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type-checking modifiers #42

Open
4 of 6 tasks
lowlighter opened this issue Oct 29, 2024 · 0 comments
Open
4 of 6 tasks

Add type-checking modifiers #42

lowlighter opened this issue Oct 29, 2024 · 0 comments
Labels
feature New feature or request scope: model
Milestone

Comments

@lowlighter
Copy link
Owner

lowlighter commented Oct 29, 2024

Scope

model

What do you want to happen?

Additional modifiers for models to make it easy to work with from the JS side.

Scope
Type casting and small transformations

Some ideas:

  • .number: force number conversion
    • .floor/.ceil,.round ? (TBD)
  • .boolean: force boolean conversion
    • using YAML booleans
  • .string: force string conversion
    • .uppercase/.lowercase (TBD)
    • .trim: trim spaces too (dismissed: difficult to implement, confusing when typing spaces before next character)
  • .nullish: treat "" as null
    • possibly <select multiple>, <input checkbox> would be null if empy arrays (dismissed: doesn't add much, easy workaround with .length)

Non-goals
Typing validation: we delegate this to browser native <input type> or to end-user discretion with their own library or custom code

I have searched for existing issues

Yes

@lowlighter lowlighter added the feature New feature or request label Oct 29, 2024
@lowlighter lowlighter added this to the future milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request scope: model
Projects
None yet
Development

No branches or pull requests

1 participant