@vidavidorra/create-project
Version:
Interactively create a GitHub project
29 lines • 777 B
JavaScript
import { z } from 'zod';
import { File } from './file.js';
const schema = z
.object({
compilerOptions: z
.object({
allowJs: z.boolean().optional(),
})
.passthrough(),
include: z.array(z.string()).min(1),
})
.strict();
class TsConfig extends File {
_tsConfig;
constructor(path, options) {
super(path, { ...options, format: true });
this._tsConfig = schema.required().parse(JSON.parse(this._content));
}
get tsConfig() {
return structuredClone(this._tsConfig);
}
process() {
delete this._tsConfig.compilerOptions.allowJs;
this._content = JSON.stringify(this._tsConfig, undefined, 2);
return this;
}
}
export { TsConfig };
//# sourceMappingURL=ts-config.js.map