joi extensions + extra goodies
$ npm install @valtech-commerce/joi
import { Joi, validateArgument } from '@valtech-commerce/joi';
class MyClass () {
constructor(path, value) {
validateArgument('path', path, Joi.absolutePath().required());
validateArgument('value', value, Joi.number().required());
// Do your stuff
}
}
Validate that the value is an absolute *nix or Windows path.
Validate that the value is a joi schema.
Validate that the value is kebab-case.
Validate that the value is a JavaScript valid variable name via is-var-name.
View documentation
MIT © Valtech Canada inc.