Add new rule `isKeyOf`
ealush opened this issue · comments
Add a new rule that checks whether a value is a key of an object.
enforce("bananas").isKeyOf({
apples: 5,
bananas: 2,
cantelopes: 0,
});
It should pass if the value passed to enforce is a key in the passed object.
To start:
- Add the new rule file under https://github.com/ealush/vest/tree/latest/packages/n4s/src/rules
- Add tests for that rule under https://github.com/ealush/vest/tree/latest/packages/n4s/src/rules/__tests__
- Reference and export that rule here https://github.com/ealush/vest/blob/latest/packages/n4s/src/runtime/rules.ts
I'll take that :)
Awesome. Let me know if you need anything from me