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

Custom Value Objects - String and Number #58

Closed
4lessandrodev opened this issue Sep 16, 2021 · 0 comments
Closed

Custom Value Objects - String and Number #58

4lessandrodev opened this issue Sep 16, 2021 · 0 comments
Labels
enhancement New feature or request feature New feature or requirements
Milestone

Comments

@4lessandrodev
Copy link
Owner

const MyCustomValidator = (value: string | number): boolean => {
    return typeof value === 'string' || typeof value === 'number';
}

CustomStringValueObject.create("this is valid", { MAX: 21, MIN: 1, VALIDATOR: MyCustomValidator });

CustomStringValueObject.create("this is an invalid value", { MAX: 5, MIN: 1, VALIDATOR: MyCustomValidator });

CustomStringValueObject.create("this is valid", { MAX: 21, MIN: 1 });

CustomNumberValueObject.create(200, { MAX: 5, MIN: 1, VALIDATOR: MyCustomValidator });

CustomNumberValueObject.create(2, { MAX: 5, MIN: 1, VALIDATOR: MyCustomValidator });

CustomNumberValueObject.create(2, { MAX: 5, MIN: 1, });
@4lessandrodev 4lessandrodev added enhancement New feature or request feature New feature or requirements labels Sep 16, 2021
@4lessandrodev 4lessandrodev added this to the value-objects milestone Sep 16, 2021
@4lessandrodev 4lessandrodev added this to To do in features-types-ddd via automation Sep 16, 2021
@4lessandrodev 4lessandrodev moved this from To do to In progress in features-types-ddd Sep 18, 2021
4lessandrodev added a commit that referenced this issue Sep 18, 2021
4lessandrodev added a commit that referenced this issue Sep 18, 2021
4lessandrodev added a commit that referenced this issue Sep 18, 2021
4lessandrodev added a commit that referenced this issue Sep 18, 2021
features-types-ddd automation moved this from In progress to Done Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature New feature or requirements
Projects
Development

No branches or pull requests

1 participant