mf-from-google-sheet
Advanced tools
Comparing version 0.5.0 to 0.5.2
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.5.0", | ||
"version": "0.5.2", | ||
"description": "Retrieve and format molecular formula from google sheet", | ||
@@ -25,4 +25,5 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"mf-generator": "^0.5.0", | ||
"mf-parser": "^0.5.0", | ||
"mf-generator": "^0.5.2", | ||
"mf-parser": "^0.5.2", | ||
"mf-utilities": "^0.5.2", | ||
"papaparse": "^4.3.6", | ||
@@ -29,0 +30,0 @@ "request": "^2.83.0", |
@@ -11,3 +11,3 @@ 'use strict'; | ||
expect(result[0].em).toBeCloseTo(5.95304980662, 5); | ||
expect(result[0].msem).toBeCloseTo(5.95250122671093, 5); | ||
expect(result[0].ms.em).toBeCloseTo(5.95250122671093, 5); | ||
}); | ||
@@ -14,0 +14,0 @@ |
@@ -64,6 +64,5 @@ 'use strict'; | ||
} | ||
// we need to calculate all the possibilities | ||
try { | ||
var mfs = generateMFs([formula.mf, formula.modif]); | ||
var mfs = generateMFs([formula.mf], { ionizations: formula.modif }); | ||
for (var mf of mfs) { | ||
@@ -99,7 +98,7 @@ mf.info = {}; | ||
results = results.filter(function (a) { | ||
return a.msem !== 0; | ||
return a.ms.em !== 0; | ||
}); | ||
results.sort(function (a, b) { | ||
return a.msem - b.msem; | ||
return a.ms.em - b.ms.em; | ||
}); | ||
@@ -110,3 +109,3 @@ | ||
for (var i = 1; i < results.length; i++) { | ||
if (results[i - 1].msem !== results[i].msem) { | ||
if (results[i - 1].ms.em !== results[i].ms.em) { | ||
uniqueResults.push(results[i]); | ||
@@ -113,0 +112,0 @@ } |
7461
6
+ Addedmf-utilities@^0.5.2
Updatedmf-generator@^0.5.2
Updatedmf-parser@^0.5.2