regexp-toolkit
Version:
A chainable regexp builder and validator
17 lines (15 loc) • 351 B
JavaScript
import {
validate
} from "./chunk-ELVR5YPO.mjs";
// bin/cli.ts
var [, , type, value] = process.argv;
if (!type || !value) {
console.error("\u274C Usage: regex-tester <type> <value>");
process.exit(1);
}
if (!validate(type, value)) {
console.log(`\u274C Invalid ${type}`);
} else {
console.log(`\u2705 Valid ${type}`);
}