chemical-elements
Advanced tools
Comparing version 1.1.13 to 1.2.0
{ | ||
"name": "chemical-elements", | ||
"version": "1.1.13", | ||
"version": "1.2.0", | ||
"description": "JSON containing information about chemical elements and isotopes", | ||
@@ -23,3 +23,3 @@ "main": "src/index.js", | ||
}, | ||
"gitHead": "3357658b99069e3a03c06471bc374c5effb919d8" | ||
"gitHead": "b044512a459c82c7bb816c52d0e90d48b8ffeae3" | ||
} |
@@ -10,2 +10,3 @@ 'use strict'; | ||
const elementsObject = require('./elementsObject.js'); | ||
const stableIsotopesObject = require('./stableIsotopesObject.js'); | ||
@@ -19,3 +20,4 @@ module.exports = { | ||
elementsAndStableIsotopesObject, | ||
stableIsotopesObject, | ||
ELECTRON_MASS, | ||
}; |
'use strict'; | ||
const elements = require('./elements.js'); | ||
const elements = require('./elements.json'); | ||
let elementsObject = {}; | ||
elements.forEach((element) => { | ||
elementsObject[element.symbol] = element; | ||
}); | ||
let isotopeObject = {}; | ||
for (const element of elements) { | ||
let abundance = 0; | ||
let mostAbundant = 0; | ||
for (const isotope of element.isotopes) { | ||
if (isotope.abundance > abundance) { | ||
abundance = isotope.abundance; | ||
mostAbundant = isotope.nominal; | ||
} | ||
} | ||
module.exports = elementsObject; | ||
for (const isotope of element.isotopes) { | ||
if (isotope.abundance === 0) continue; | ||
const entry = { | ||
name: element.name, | ||
mass: isotope.mass, | ||
symbol: element.symbol, | ||
}; | ||
if (isotope.nominal === mostAbundant) { | ||
entry.mostAbundant = true; | ||
} | ||
isotopeObject[isotope.nominal + element.symbol] = entry; | ||
} | ||
} | ||
module.exports = isotopeObject; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
135551
16
132