Completed
Push — master ( 6e8dba...bda2ec )
by Andres
30s
created

build_scripts/generate_element_slot.js   A

Complexity

Total Complexity 2
Complexity/F 0

Size

Lines of Code 24
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
wmc 2
c 1
b 0
f 0
nc 4
mnd 1
bc 2
fnc 0
dl 0
loc 24
rs 10
bpm 0
cpm 0
noi 0
1
/* eslint-env node */
2
/*jslint node: true */
3
'use strict';
4
5
let jsonfile = require('jsonfile');
6
7
let generators = jsonfile.readFileSync('build/data/generators.json');
8
let upgrades = jsonfile.readFileSync('build/data/upgrades.json');
9
10
let slot = {};
11
12
slot.upgrades = {};
13
for (let upgrade in upgrades) {
14
  slot.upgrades[upgrade] = false;
15
}
16
slot.generators = {};
17
for (let generator in generators) {
18
  slot.generators[generator] = 0;
19
}
20
21
slot.reactions = [];
22
slot.redoxes = [];
23
24
jsonfile.writeFileSync('build/data/element_slot.json', slot, {
25
  spaces: 2
26
});
27