ts-variant-gen
Version:
Small utility to generate F#/Kotlin-style discriminated unions (variant types) for TypeScript projects
13 lines (12 loc) • 385 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
var ts_node_1 = require("ts-node");
if (process.argv.length != 3) {
console.error("Usage: ts-variant-gen [js definition file]");
process.exit(1);
}
var fileName = process.argv[2];
var filePath = path.join(process.cwd(), fileName);
ts_node_1.register();
require(filePath);