bot18
Version:
A high-frequency cryptocurrency trading bot by Zenbot creator @carlos8f
7 lines • 332 B
JavaScript
module.exports = function compile(format, context) {
format = format.replace(/"/g, '\\"');
var js = ' return "' + format.replace(/%(>?\w|{[\w-]+}i)/g, function(_, name) {
return '"\n + (tokens["' + name + '"].call(this, req, res) || "-") + "';
}) + '";';
return new Function('tokens, req, res', js).bind(context);
};