actaeon/process-db.js

11 lines
387 B
JavaScript
Raw Permalink Normal View History

2024-03-12 10:40:53 +00:00
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);