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 rule isValueOf #758

Closed
ealush opened this issue Jan 7, 2022 · 5 comments
Closed

Add rule isValueOf #758

ealush opened this issue Jan 7, 2022 · 5 comments
Assignees
Labels
enforce good first issue Good for newcomers

Comments

@ealush
Copy link
Owner

ealush commented Jan 7, 2022

Add a new rule that checks whether a value is a value in an object.

enforce("Bravo").isValueOf({
	a: "Alpha",
	b: "Bravo",
  	c: "Charlie",
});

It should pass if the value passed to enforce is a value in the passed object.

To start:

  1. Add the new rule file under https://github.com/ealush/vest/tree/latest/packages/n4s/src/rules
  2. Add tests for that rule under https://github.com/ealush/vest/tree/latest/packages/n4s/src/rules/__tests__
  3. Reference and export that rule here https://github.com/ealush/vest/blob/latest/packages/n4s/src/runtime/rules.ts
@ealush ealush added good first issue Good for newcomers enforce labels Jan 7, 2022
@davidmeirlevy
Copy link

I’ll take that :)

@ealush
Copy link
Owner Author

ealush commented Jan 8, 2022

Awesome. Let me know if you have any questions.

@saard
Copy link
Contributor

saard commented Jan 8, 2022

@ealush is something wrong with my PR?
#760

@davidmeirlevy
Copy link

Maybe @ealush didn't notice this PR is connected to that issue.
@ealush his PR looks fine. I would maybe add some more tests cases, but that's all.

@ealush
Copy link
Owner Author

ealush commented Jan 10, 2022

Thanks @davidmeirlevy, yeah, it seems that you both reacted to this issue at the same time, @saard through a PR and you here. No worries.

@ealush ealush closed this as completed Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enforce good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants