Class: RegExpStringValidator
Standardized way to allow string/regex validation within configuration
If url is prefixed with regex:
it is considered a regex
Example
class MyServiceParameters extends ServiceParameters {
urls: string[];
}
class MyService extends Service {
loadParameters(params:any) {
const parameters = new MyServiceParameters(params);
this.urlsValidator = new RegExpStringValidator(parameters.urls);
return parameters;
}
}
Extends
Constructors
new RegExpStringValidator(info)
new RegExpStringValidator(
info
):RegExpStringValidator
Parameters
• info: string
| string
[]
Returns
Overrides
Source
packages/core/src/services/service.ts:228
Properties
stringValidators
stringValidators:
string
[]
Source
packages/core/src/services/service.ts:227
validators
protected
validators:RegExp
[]
Inherited from
Source
packages/core/src/services/service.ts:186
Methods
validate()
validate(
value
):boolean
Add string validation
Parameters
• value: string
Returns
boolean
Overrides
Source
packages/core/src/services/service.ts:239
getRegExp()
static
getRegExp(reg
):RegExp
Parameters
• reg: string
Returns
RegExp