validator/types/base.js
Jay 46b19757bd
All checks were successful
continuous-integration/drone/push Build is passing
[feat] add string type pattern check, add object child check
2020-06-10 13:32:50 +00:00

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