mf-generator
Advanced tools
Comparing version 1.3.16 to 1.3.17
{ | ||
"name": "mf-generator", | ||
"version": "1.3.16", | ||
"version": "1.3.17", | ||
"description": "", | ||
@@ -22,9 +22,12 @@ "main": "src/index.js", | ||
"chemical-elements": "^1.2.0", | ||
"mf-finder": "^1.2.4", | ||
"mf-matcher": "^1.1.22", | ||
"mf-parser": "^1.4.3", | ||
"mf-utilities": "^1.2.16", | ||
"mf-finder": "^1.2.5", | ||
"mf-matcher": "^1.2.0", | ||
"mf-parser": "^1.4.4", | ||
"mf-utilities": "^1.3.0", | ||
"sum-object-keys": "^1.0.2" | ||
}, | ||
"gitHead": "cfe22caded1fa8266dfc28df065f4d8d71fd031e" | ||
"devDependencies": { | ||
"jest-matcher-deep-close-to": "^3.0.2" | ||
}, | ||
"gitHead": "0cceb8fe88adb924d371419bf3738b0e2d0a438c" | ||
} |
# mf-generator | ||
[![NPM version][npm-image]][npm-url] | ||
[![npm download][download-image]][download-url] | ||
[![NPM version][npm-image]][npm-url] | ||
[![npm download][download-image]][download-url] | ||
@@ -15,8 +15,11 @@ . | ||
```js | ||
import generateMFs from 'mf-generator'; | ||
const generateMFs = require('mf-generator'); | ||
const mfsArray = ['C,H,', 'Cl,Br']; | ||
const result = generateMFs(mfsArray).map((entry) => entry.mf); | ||
generateMFs(mfsArray).then((entries) => { | ||
const results = entries.map((entry) => entry.mf); | ||
console.log(results); | ||
}); | ||
// result = 'Cl', 'HCl', 'CCl', 'Br', 'HBr', 'CBr' | ||
``` | ||
@@ -26,3 +29,3 @@ | ||
[MIT](./LICENSE) | ||
[MIT](./LICENSE) | ||
@@ -29,0 +32,0 @@ [npm-image]: https://img.shields.io/npm/v/mf-generator.svg?style=flat-square |
@@ -171,2 +171,3 @@ 'use strict'; | ||
"ionization": Object { | ||
"atoms": Object {}, | ||
"charge": 0, | ||
@@ -238,3 +239,5 @@ "em": 0, | ||
let mfsArray = ['(H+)-2--4']; | ||
let result = await generateMFs(mfsArray); | ||
let result = await generateMFs(mfsArray, { | ||
filter: { allowNegativeAtoms: true }, | ||
}); | ||
expect(result.map((a) => a.ms.em).sort((a, b) => a - b)).toStrictEqual([ | ||
@@ -241,0 +244,0 @@ -1.0072764523209299, -1.0072764523209299, -1.0072764523209299, |
@@ -33,7 +33,8 @@ 'use strict'; | ||
* @param {number} [options.filter.maxCharge=+Infinity] - Maximal charge | ||
* @param {object} [options.filter.unsaturation={}}] | ||
* @param {boolean} [options.filter.allowNegativeAtoms=false] - Allow to have negative number of atoms | ||
* @param {object} [options.filter.unsaturation={}] | ||
* @param {number} [options.filter.unsaturation.min=-Infinity] - Minimal unsaturation | ||
* @param {number} [options.filter.unsaturation.max=+Infinity] - Maximal unsaturation | ||
* @param {boolean} [options.filter.unsaturation.onlyInteger=false] - Integer unsaturation | ||
* @param {boolean} [options.filter.unsaturation.onlyNonInteger=false] - Non integer unsaturation | ||
* @param {boolean} [options.filter.unsaturation.onlyInteger=false] - Integer unsaturation | ||
* @param {boolean} [options.filter.unsaturation.onlyNonInteger=false] - Non integer unsaturation | ||
* @param {object} [options.filter.atoms] - object of atom:{min, max} | ||
@@ -40,0 +41,0 @@ * @param {function} [options.filter.callback] - a function to filter the MF |
21626
6
533
34
1
Updatedmf-finder@^1.2.5
Updatedmf-matcher@^1.2.0
Updatedmf-parser@^1.4.4
Updatedmf-utilities@^1.3.0