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);
