UNPKG

@vidavidorra/create-project

Version:
23 lines 701 B
import { z } from 'zod'; import { File } from './file.js'; const schema = z.strictObject({ compilerOptions: z.looseObject({ allowJs: z.boolean().optional() }), include: z.array(z.string()).min(1), }); class TsConfig extends File { _config; constructor(path, options) { super(path, { ...options, format: true }); this._config = schema.parse(JSON.parse(this._content)); } get config() { return structuredClone(this._config); } process() { delete this._config.compilerOptions.allowJs; this._content = JSON.stringify(this._config, undefined, 2); return this; } } export { TsConfig }; //# sourceMappingURL=ts-config.js.map