Compare commits
No commits in common. "6a36df3593632d6d060ae03a94241ef7f3c4102e" and "aeb405967b175dc267461278afa69387dd7c61f9" have entirely different histories.
6a36df3593
...
aeb405967b
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.28.2",
|
"version": "1.28.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.28.2",
|
"version": "1.28.1",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "^8.3.0",
|
"better-sqlite3": "^8.3.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.28.2",
|
"version": "1.28.1",
|
||||||
"description": "Game host for SChat 2-powered chat sites",
|
"description": "Game host for SChat 2-powered chat sites",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
25
src/merge.js
25
src/merge.js
|
@ -1,25 +0,0 @@
|
||||||
const path = require('path');
|
|
||||||
const args = require('yargs').argv;
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
const scoresA = require(path.resolve(__dirname, args.a));
|
|
||||||
const scoresB = require(path.resolve(__dirname, args.b));
|
|
||||||
|
|
||||||
const sum = {};
|
|
||||||
|
|
||||||
[scoresA, scoresB].forEach((record) => {
|
|
||||||
Object.entries(record).forEach(([game, scores]) => {
|
|
||||||
if (!sum[game]) {
|
|
||||||
sum[game] = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.entries(scores).forEach(([id, score]) => {
|
|
||||||
sum[game][id] = (sum[game][id] || 0) + score;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(JSON.stringify(sum, null, 4));
|
|
||||||
}
|
|
||||||
|
|
||||||
init();
|
|
Loading…
Reference in New Issue