mirror of
https://github.com/gorules/zen.git
synced 2026-10-04 08:02:28 +00:00
* feat: replace v8 with quickjs * fix format; fix pipelines * fix: workflow * fix: remove incorrect target in node windows pipeline
26 lines
586 B
JavaScript
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,
|
|
});
|