Files
zen/core/engine/js/internals.js
T
stefan-gorules c281c55ef1 feat: replace v8 with quickjs (#119)
* feat: replace v8 with quickjs

* fix format; fix pipelines

* fix: workflow

* fix: remove incorrect target in node windows pipeline
2024-02-09 10:48:08 +01:00

26 lines
586 B
JavaScript

import 'dayjs';
import 'big';
const log = [];
globalThis.console = {
log: (...args) => {
try {
log.push({
msSinceRun: Date.now() - now,
lines: args.map(a => JSON.stringify(a))
});
} catch (e) {
log.push({
msSinceRun: Date.now() - now,
lines: [JSON.stringify('failed to parse logging line')]
});
}
}
};
globalThis.main = (input) => JSON.stringify({
output: handler(input, {moment: dayjs, dayjs: dayjs, Big: Big, env: {}}),
log,
});