pdf upload checkpoint1
This commit is contained in:
15
packages/db/scripts/patch-zod-buffer.ts
Normal file
15
packages/db/scripts/patch-zod-buffer.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const dir = path.resolve(__dirname, '../shared/schemas/objects');
|
||||
|
||||
fs.readdirSync(dir).forEach(file => {
|
||||
if (!file.endsWith('.schema.ts')) return;
|
||||
const full = path.join(dir, file);
|
||||
let content = fs.readFileSync(full, 'utf8');
|
||||
if (content.includes('z.instanceof(Buffer)') && !content.includes("import { Buffer")) {
|
||||
content = `import { Buffer } from 'buffer';\n` + content;
|
||||
fs.writeFileSync(full, content);
|
||||
console.log('Patched:', file);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user