mf-generator
Advanced tools
Comparing version 1.1.6 to 1.2.0
@@ -6,4 +6,15 @@ # Change Log | ||
# [1.2.0](https://github.com/cheminfo/molecular-formula/compare/mf-generator@1.1.6...mf-generator@1.2.0) (2020-08-19) | ||
### Features | ||
* limit number of generated MF ([d361ed7](https://github.com/cheminfo/molecular-formula/commit/d361ed75f1d129fda64b19c2ee3cd421486aeeac)) | ||
## [1.1.6](https://github.com/cheminfo/molecular-formula/compare/mf-generator@1.1.5...mf-generator@1.1.6) (2020-04-18) | ||
**Note:** Version bump only for package mf-generator |
{ | ||
"name": "mf-generator", | ||
"version": "1.1.6", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -22,9 +22,9 @@ "main": "src/index.js", | ||
"chemical-elements": "^1.1.5", | ||
"mf-finder": "^1.1.5", | ||
"mf-matcher": "^1.1.5", | ||
"mf-parser": "^1.1.5", | ||
"mf-utilities": "^1.1.5", | ||
"mf-finder": "^1.1.6", | ||
"mf-matcher": "^1.1.6", | ||
"mf-parser": "^1.1.6", | ||
"mf-utilities": "^1.2.0", | ||
"sum-object-keys": "^1.0.2" | ||
}, | ||
"gitHead": "9fcd8f8e0a32750245826401f8d53d567148353a" | ||
"gitHead": "cfb4dd864b00757572700c8751b620d500682476" | ||
} |
@@ -39,4 +39,3 @@ 'use strict'; | ||
module.exports = function generateMFs(keys, options = {}) { | ||
let { limit = 10000000, uniqueMFs = true, estimate = false } = options; | ||
let { limit = 100000, uniqueMFs = true, estimate = false } = options; | ||
if (uniqueMFs === true) options.canonizeMF = true; | ||
@@ -69,3 +68,3 @@ if (options.canonizeMF === undefined) options.canonizeMF = true; | ||
// there are ranges ... we are in trouble ! | ||
newParts = newParts.concat(processRange(part, comment)); | ||
newParts = newParts.concat(processRange(part, comment, { limit })); | ||
} else { | ||
@@ -113,7 +112,8 @@ newParts.push(parts[j]); // the part with the comments ! | ||
} | ||
appendResult(results, currents, keys, options); | ||
if (uniqueMFs) { | ||
let uniqueMFsObject = {}; | ||
results.forEach((r) => { | ||
uniqueMFsObject[r.mf + r.ionization.mf] = r; | ||
results.forEach((result) => { | ||
uniqueMFsObject[result.mf + result.ionization.mf] = result; | ||
}); | ||
@@ -120,0 +120,0 @@ results = Object.keys(uniqueMFsObject).map((k) => uniqueMFsObject[k]); |
16818
Updatedmf-finder@^1.1.6
Updatedmf-matcher@^1.1.6
Updatedmf-parser@^1.1.6
Updatedmf-utilities@^1.2.0