mf-generator
Advanced tools
Comparing version 1.4.0 to 2.0.0
{ | ||
"name": "mf-generator", | ||
"version": "1.4.0", | ||
"description": "", | ||
"main": "src/index.js", | ||
"version": "2.0.0", | ||
"description": "Generate molecular formula based on a range and filters", | ||
"main": "lib/index.js", | ||
"module": "src/index.js", | ||
"files": [ | ||
"src" | ||
"src", | ||
"lib" | ||
], | ||
@@ -19,9 +21,9 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/cheminfo/mass-tools/tree/master/packages/mf-generator#readme", | ||
"homepage": "https://github.com/cheminfo/mass-tools/tree/main/packages/mf-generator#readme", | ||
"dependencies": { | ||
"chemical-elements": "^1.3.0", | ||
"mf-finder": "^1.5.0", | ||
"mf-matcher": "^1.3.0", | ||
"mf-parser": "^1.5.0", | ||
"mf-utilities": "^1.5.0", | ||
"chemical-elements": "^2.0.0", | ||
"mf-finder": "^2.0.0", | ||
"mf-matcher": "^2.0.0", | ||
"mf-parser": "^2.0.0", | ||
"mf-utilities": "^2.0.0", | ||
"sum-object-keys": "^1.0.2" | ||
@@ -32,3 +34,3 @@ }, | ||
}, | ||
"gitHead": "ade929b07af4e2f0f8b3fe1aaf0df70c50f4b2db" | ||
"gitHead": "c6ebfbd64c711f8839a02a43c5708e71a379885b" | ||
} |
@@ -15,3 +15,3 @@ # mf-generator | ||
```js | ||
const generateMFs = require('mf-generator'); | ||
const { generateMFs } = require('mf-generator'); | ||
@@ -18,0 +18,0 @@ const mfsArray = ['C,H,', 'Cl,Br']; |
@@ -1,5 +0,3 @@ | ||
'use strict'; | ||
import { generateMFs } from '..'; | ||
const generateMFs = require('..'); | ||
describe('generateMFs', () => { | ||
@@ -6,0 +4,0 @@ it('from array of array with comment', async () => { |
@@ -1,9 +0,7 @@ | ||
'use strict'; | ||
import { toBeDeepCloseTo } from 'jest-matcher-deep-close-to'; | ||
const { toBeDeepCloseTo } = require('jest-matcher-deep-close-to'); | ||
import { generateMFs } from '..'; | ||
expect.extend({ toBeDeepCloseTo }); | ||
const generateMFs = require('..'); | ||
describe('generateMFs advanced', () => { | ||
@@ -10,0 +8,0 @@ it('negative', async () => { |
@@ -1,9 +0,6 @@ | ||
'use strict'; | ||
const { ELECTRON_MASS } = require('chemical-elements/src/constants'); | ||
const MF = require('mf-parser').MF; | ||
const matcher = require('mf-matcher').msem; | ||
const preprocessIonizations = require('mf-utilities/src/preprocessIonizations'); | ||
const processRange = require('mf-utilities/src/processRange'); | ||
const sum = require('sum-object-keys'); | ||
import { ELECTRON_MASS } from 'chemical-elements'; | ||
import { msemMatcher } from 'mf-matcher'; | ||
import { MF } from 'mf-parser'; | ||
import { processRange, preprocessIonizations } from 'mf-utilities'; | ||
import sum from 'sum-object-keys'; | ||
/** | ||
@@ -47,3 +44,3 @@ * Generate all the possible combinations of molecular formula and calculate | ||
module.exports = async function generateMFs(keys, options = {}) { | ||
export async function generateMFs(keys, options = {}) { | ||
options = { ...options }; | ||
@@ -155,3 +152,3 @@ | ||
return results; | ||
}; | ||
} | ||
@@ -203,3 +200,3 @@ let ems = {}; | ||
mw, | ||
ionization: ionization, | ||
ionization, | ||
unsaturation: validUnsaturation ? unsaturation / 2 + 1 : undefined, | ||
@@ -268,3 +265,3 @@ atoms, | ||
let match = matcher(result, filter); | ||
let match = msemMatcher(result, filter); | ||
if (!match) continue; | ||
@@ -271,0 +268,0 @@ result.ms = match.ms; |
31139
7
781
2
+ Addedatom-sorter@2.2.0(transitive)
+ Addedchemical-elements@2.2.0(transitive)
+ Addedchemical-groups@2.2.2(transitive)
+ Addedmf-finder@2.4.1(transitive)
+ Addedmf-matcher@2.1.1(transitive)
+ Addedmf-parser@2.3.1(transitive)
+ Addedmf-utilities@2.0.5(transitive)
+ Addedml-spectra-processing@12.11.0(transitive)
- Removedatom-sorter@1.2.0(transitive)
- Removedchemical-elements@1.3.0(transitive)
- Removedchemical-groups@1.3.0(transitive)
- Removedmf-finder@1.5.0(transitive)
- Removedmf-matcher@1.3.0(transitive)
- Removedmf-parser@1.5.0(transitive)
- Removedmf-utilities@1.5.0(transitive)
- Removedml-spectra-processing@11.17.0(transitive)
- Removedpapaparse@5.5.2(transitive)
Updatedchemical-elements@^2.0.0
Updatedmf-finder@^2.0.0
Updatedmf-matcher@^2.0.0
Updatedmf-parser@^2.0.0
Updatedmf-utilities@^2.0.0