validator/types/base.js

29 lines
378 B
JavaScript

/**
* type builder interface
*
* @class
* @exports
*/
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