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

Make the rules optional #141

Open
aminnairi opened this issue Dec 13, 2023 · 0 comments
Open

Make the rules optional #141

aminnairi opened this issue Dec 13, 2023 · 0 comments
Assignees
Labels
feature New feature or request
Milestone

Comments

@aminnairi
Copy link
Owner

aminnairi commented Dec 13, 2023

Is your feature request related to a problem? Please describe.
In case there is no rule to be applied to a schema, the library still forces the developer to write a rule.

Describe the solution you'd like
The rules property for each schema should be optional, and default to an empty array.

import * as Kryptonian from "kryptonian";

// This
Kryptonian.Kalel.string({
  message: ""
});

// Instead of this
Kryptonian.Kalel.string({
  rules: [].
  message: ""
});

Describe alternatives you've considered
None.

Additional context
This would require a tiny amount of handling in the source-code, but could potentially reduce the amount of code needed to be written in the developer side.

@aminnairi aminnairi added the feature New feature or request label Dec 13, 2023
@aminnairi aminnairi added this to the 4.1.0 milestone Dec 13, 2023
@aminnairi aminnairi self-assigned this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant