Files
stefan-gorules cc3d938b2f feat: function v2 (#212)
* feat: function v2

* expose evaluate

* remove async trait, add caching

* fix naming

* add reverse compatibility

* add http module

* update impl

* resolve issues with reqwest

* fix

* fix

* fix ssl

* remove unused deps

* fix: tests

* fix
2024-07-16 11:22:51 +02: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,
});