"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const factory_1 = __importDefault(require("../src/serializer/factory"));
// const decoder = new TextDecoder()
// const functionBody = decoder.decode(fs.readFileSync('./testFactory.js'))
// new Function(functionBody)(1,2,3)
const prepared = factory_1.default('./dev/data/jobs/from');
fs_1.default.writeFileSync('__factory.ts', prepared, 'utf-8');
const result = require('esbuild').buildSync({
    entryPoints: ['__factory.ts'],
    bundle: true,
    platform: 'node',
    write: false,
    external: ['pg-native'],
});
const decoder = new TextDecoder();
const ts = eval(decoder.decode(result.outputFiles[0].contents));
console.log(ts);
// fs.writeFileSync('__out.ts', ts, 'utf-8')
// const result2 = require('esbuild').buildSync({
//     entryPoints: ['__out.ts'],
//     bundle: true,
//     platform: 'node',
//     write: false,
//     external: ['pg-native'],
// });
// console.log(eval(decoder.decode(result2.outputFiles[0].contents)))
//# sourceMappingURL=test-build.js.map