Interface RuleHandle

Source
Expand description

A handle to a registered rule. All methods return this for chaining.

example
server.when("hello").reply("Hi!").times(3);
server.when("urgent").reply("On it!").first();
interface RuleHandle {
    first(): RuleHandle;
    times(n: number): RuleHandle;
}

Methods§

Source§

first(): RuleHandle

Move this rule to the front of the list so it matches first.

Source§

times(n: number): RuleHandle

Auto-expire the rule after n matches.