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

mf-generator

Package Overview
Dependencies
Maintainers
1
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 0.5.2 to 0.5.3

4

package.json
{
"name": "mf-generator",
"version": "0.5.2",
"version": "0.5.3",
"description": "",

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

"mf-finder": "^0.5.2",
"mf-matcher": "^0.5.2",
"mf-matcher": "^0.5.3",
"mf-parser": "^0.5.2",

@@ -26,0 +26,0 @@ "mf-utilities": "^0.5.2",

@@ -8,3 +8,4 @@ 'use strict';

var result = generateMFs(mfsArray);
expect(result[0].mf).toBe('HCl$YY');
expect(result[0].mf).toBe('HCl');
expect(result[0].comment).toBe('YY');
expect(result).toHaveLength(4);

@@ -136,3 +137,4 @@ });

var result = generateMFs(mfsArray);
expect(result[0].mf).toBe('CO$1>10 D2>20');
expect(result[0].mf).toBe('CO');
expect(result[0].comment).toBe('1>10 D2>20');
});

@@ -139,0 +141,0 @@

@@ -12,2 +12,3 @@ 'use strict';

* for each of them the monoisotopic mass and observed moniisotopic mass (m/z)
* In the molecular formula there may be a comment after the '$' symbol
*

@@ -36,3 +37,2 @@ * @param keys

module.exports = function generateMFs(keys, options = {}) {

@@ -193,3 +193,2 @@ let {

if (key) {
result.parts[i] = key;
if (key.indexOf('$') > -1) {

@@ -199,2 +198,3 @@ comments.push(key.replace(/^[^$]*\$/, ''));

}
result.parts[i] = key;
result.mf += key;

@@ -208,6 +208,7 @@ }

if (comments.length > 0) result.mf += `$${comments.join(' ')}`;
if (comments.length > 0) {
result.comment = comments.join(' ');
}
results.push(result);
}
}

@@ -214,0 +215,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