alp-node
Version:
framework based on koa 2
14 lines (11 loc) • 373 B
text/typescript
import ParamValueValidator from "./ParamValueValidator";
export default class ParamValueStringValidator<
T extends string = string,
> extends ParamValueValidator<T | null | undefined> {
notEmpty(): ParamValueValidator<T> {
if (this.value == null || this.value.trim() === "") {
this._error("notEmpty");
}
return this as ParamValueValidator<T>;
}
}