推荐通过npm安装
npm i -S @litert/typeguard
在 Node.js 中使用:
import * as TyG from "@litert/typeguard";
const tgc = createJavaScriptCompiler();
const isValidString = tgc.compile(
"string(1,255)"
);
console.log(isValidString("FF")); // true
console.log(isValidString("")); // false
console.log(isValidString(null)); // false