Abstract class of strategy for univalid module.
npm i univalid-strategy
const UnivalidStrategy = require('univalid-strategy');
class UnivalidStrategyDefault extends UnivalidStrategy {
//...
}
Methods are necessary for define and extend.
Tests the pattern matching of symbols (by event)
filter - Type string
In current moment available patterns:
- oL - only latin symbols
- oC - only cyrillic symbols
- oN - only numbers
- oP - only numbers and latin symbols
val - Type string
constructor(){
this.validHandlers = {
'required': (val) => {
let data = val ? ('' + val).trim() : '';
return !!data;
}
}
}
ISC©