mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-04-02 05:23:21 +00:00
feat: add not
This commit is contained in:
@@ -87,6 +87,10 @@ export function rangeOr(...ranges: (string | Checker)[]): Checker {
|
||||
return firstCheck;
|
||||
}
|
||||
|
||||
export function notRange(range: string | Checker): Checker {
|
||||
return rangeOf(range).not();
|
||||
}
|
||||
|
||||
|
||||
export class EmVar {
|
||||
static from(range: string | EmVar): EmVar {
|
||||
@@ -148,4 +152,7 @@ export class Checker {
|
||||
public or(other: Checker): Checker {
|
||||
return new Checker((value) => this.check(value) || other.check(value));
|
||||
}
|
||||
public not(): Checker {
|
||||
return new Checker((value) => !this.check(value));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user