actaeon/process-db.js
2024-03-12 06:40:53 -04:00

11 lines
387 B
JavaScript

const fs = require('fs');
const data = fs.readFileSync('./src/types/db.d.ts').toString();
const lines = data.split(/\r?\n/g);
const removed = ['// Do not edit. File generated by kysely-codegen\n',
...lines.slice(lines.findIndex(l => l.includes(' interface ')))
.map(l => l.replace(/Generated<(.+?)>/g, '$1'))]
.join('\n');
fs.writeFileSync('./src/types/db.d.ts', removed);