Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mf-generator

Package Overview
Dependencies
Maintainers
2
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mf-generator - npm Package Compare versions

Comparing version 1.3.16 to 1.3.17

src/__tests__/negative.test.js

15

package.json
{
"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,

7

src/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc