validator/types/base.js
2020-06-03 15:49:04 +00:00

28 lines
370 B
JavaScript

/**
* type builder interface
*
* @interface
*/
class BaseType {
constructor () {
this._type = 'base'
this._required = false
}
required () {
this._required = true
return this
}
/**
* validate data
* @param {any} value
* @return {string?}
*/
validate (value) {
throw new Error('not impl')
}
}
module.exports = BaseType