mirror of
https://github.com/yldio/copilot.git
synced 2024-11-11 05:40:11 +02:00
8295bd6882
this shall be a progressive process
13 lines
345 B
JavaScript
13 lines
345 B
JavaScript
const flatten = require('lodash.flatten');
|
|
const remcalc = require('remcalc');
|
|
|
|
const BASE = 6;
|
|
|
|
const calc = (base, ...values) =>
|
|
flatten(values.map(value => String(value).split(/\s/gim)))
|
|
.map(value => remcalc(Number(value) * base))
|
|
.join(' ');
|
|
|
|
module.exports = (...values) => calc(BASE, ...values);
|
|
module.exports.withBase = calc;
|