assertMatch
import { assertMatch } from "jsr:@ende/assert";function
function assertMatch(actual: string, expected: RegExp, msg?: string): voidMake an assertion that actual match RegExp expected. If not
then throw.
actual: stringThe actual value to be matched.
expected: RegExpThe expected pattern to match.
msg?: stringThe optional message to display if the assertion fails.
Example: Usage
import { assertMatch } from "@ende/assert";
assertMatch("Raptor", /Raptor/); // Doesn't throw
assertMatch("Denosaurus", /Raptor/); // Throws