Total Complexity | 2 |
Complexity/F | 0 |
Lines of Code | 20 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /* eslint-env node */ |
||
3 | 'use strict'; |
||
4 | |||
5 | let jsonfile = require('jsonfile'); |
||
6 | |||
7 | let elements = jsonfile.readFileSync('build/data/elements.json'); |
||
8 | |||
9 | let matrix = {}; |
||
10 | |||
11 | for (let i in elements) { |
||
12 | let element = elements[i]; |
||
13 | matrix[element.number] = {}; |
||
14 | for(let isotope in element.isotopes){ |
||
15 | let number = parseInt(isotope, 10); |
||
16 | matrix[element.number][number] = isotope; |
||
17 | } |
||
18 | } |
||
19 | |||
20 | jsonfile.writeFileSync('build/data/resource_matrix.json', matrix, { |
||
21 | spaces: 2 |
||
22 | }); |
||
23 |