New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mf-finder

Package Overview
Dependencies
Maintainers
2
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mf-finder - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

4

package.json
{
"name": "mf-finder",
"version": "1.4.0",
"version": "1.4.1",
"description": "Find a molecular formula from a monoisotopic mass",

@@ -27,3 +27,3 @@ "main": "src/index.js",

},
"gitHead": "988291b8d79f39fc2074f384845dd5878dea19fd"
"gitHead": "e4ecee35a3769aa536b1d334de748deb5b8aefd8"
}

@@ -147,2 +147,16 @@ 'use strict';

it('ethylbenzene with uniqueMF', async () => {
let result1 = await findMFs(519.127524, {
ranges: 'C0-100 H0-200 N0-20 O0-20 F0-3',
allowNeutral: true,
uniqueMFs: false,
});
let result2 = await findMFs(519.127524, {
ranges: 'C0-100 H0-200 N0-20 O0-20 F0-3',
allowNeutral: true,
uniqueMFs: true,
});
expect(result1.mfs).toHaveLength(result2.mfs.length);
});
it('ethane with groups in parenthesis and uniqueMF', async () => {

@@ -149,0 +163,0 @@ let result = await findMFs(30.04695, {

@@ -174,4 +174,4 @@ 'use strict';

if (result.mfs.length > 2 * limit) {
if (uniqueMFs) ensureUniqueMF(result);
result.mfs.sort((a, b) => Math.abs(a.ms.ppm) - Math.abs(b.ms.ppm));
if (uniqueMFs) ensureUniqueMF(result);
result.mfs.length = limit;

@@ -213,4 +213,4 @@ }

if (uniqueMFs) ensureUniqueMF(result);
result.mfs.sort((a, b) => Math.abs(a.ms.ppm) - Math.abs(b.ms.ppm));
if (uniqueMFs) ensureUniqueMF(result);
if (result.mfs.length > limit) {

@@ -229,2 +229,3 @@ result.mfs.length = limit;

function ensureUniqueMF(result) {
result.mfs.sort((a, b) => a.em - b.em);
let previousEM = 0;

@@ -240,2 +241,3 @@ let bestCounts = [];

for (let i = 0; i < current.currentCounts.length; i++) {
// better priority ???
if (current.currentCounts[i] > bestCounts[i]) {

@@ -252,4 +254,2 @@ mfs.pop();

}
// better priority ???
}

@@ -256,0 +256,0 @@ }

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