jcampconverter
Advanced tools
Comparing version 7.6.5 to 7.6.6
# Changelog | ||
### [7.6.6](https://www.github.com/cheminfo/jcampconverter/compare/v7.6.5...v7.6.6) (2021-01-18) | ||
### Bug Fixes | ||
* deal with 2D jcamp without all .nucleus ([3cf7cc0](https://www.github.com/cheminfo/jcampconverter/commit/3cf7cc0907866505f430f4cf359d3b6e0f711878)) | ||
### [7.6.5](https://www.github.com/cheminfo/jcampconverter/compare/v7.6.4...v7.6.5) (2020-10-27) | ||
@@ -4,0 +11,0 @@ |
@@ -667,2 +667,17 @@ 'use strict'; | ||
// we will check if some nucleus are missing ... | ||
if (entry.ntuples && entry.ntuples.nucleus && entry.ntuples.symbol) { | ||
for (let i = 0; i < entry.ntuples.nucleus.length; i++) { | ||
let symbol = entry.ntuples.symbol[i]; | ||
let nucleus = entry.ntuples.nucleus[i]; | ||
if (symbol.startsWith('F') && !nucleus) { | ||
if (symbol === 'F1') entry.ntuples.nucleus[i] = entry.tmp.$NUC2; | ||
if (symbol === 'F2') entry.ntuples.nucleus[i] = entry.tmp.$NUC1; | ||
} | ||
if (symbol === 'F2') { | ||
entry.yType = entry.ntuples.nucleus[0]; | ||
} | ||
} | ||
} | ||
if ( | ||
@@ -757,2 +772,3 @@ observeFrequency && | ||
} | ||
delete entry.tmp; | ||
} | ||
@@ -1001,2 +1017,3 @@ } | ||
meta: {}, | ||
tmp: {}, // tmp information we need to keep for postprocessing | ||
}; | ||
@@ -1101,5 +1118,2 @@ parentEntry.children.push(currentEntry); | ||
} | ||
if (currentEntry.twoD) { | ||
currentEntry.yType = dataValue.split(ntuplesSeparatorRegExp)[0]; | ||
} | ||
} else if (canonicDataLabel === 'PAGE') { | ||
@@ -1115,2 +1129,6 @@ spectrum.page = dataValue.trim(); | ||
spectrum.sampleDescription = dataValue; | ||
} else if (canonicDataLabel.startsWith('$NUC')) { | ||
if (!currentEntry.tmp[canonicDataLabel] && !dataValue.includes('off')) { | ||
currentEntry.tmp[canonicDataLabel] = dataValue.replace(/[<>]/g, ''); | ||
} | ||
} else if (canonicDataLabel === 'END') { | ||
@@ -1117,0 +1135,0 @@ currentEntry = parentsStack.pop(); |
{ | ||
"name": "jcampconverter", | ||
"version": "7.6.5", | ||
"version": "7.6.6", | ||
"description": "Parse and convert JCAMP data", | ||
@@ -50,20 +50,20 @@ "main": "lib/index.js", | ||
"@babel/plugin-transform-modules-commonjs": "^7.12.1", | ||
"@types/jest": "^26.0.15", | ||
"@types/jest": "^26.0.20", | ||
"benchmark": "^2.1.4", | ||
"cheminfo-build": "^1.1.8", | ||
"eslint": "^7.12.1", | ||
"cheminfo-build": "^1.1.9", | ||
"eslint": "^7.18.0", | ||
"eslint-config-cheminfo": "^5.2.2", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.1.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"esm": "^3.2.25", | ||
"jest": "^26.6.1", | ||
"jest": "^26.6.3", | ||
"jest-matcher-deep-close-to": "^2.0.1", | ||
"prettier": "^2.1.2", | ||
"rollup": "^2.32.1" | ||
"prettier": "^2.2.1", | ||
"rollup": "^2.36.2" | ||
}, | ||
"dependencies": { | ||
"ml-array-median": "^1.1.4", | ||
"nmr-processing": "^0.3.0" | ||
"nmr-processing": "^0.5.0" | ||
} | ||
} |
@@ -160,2 +160,3 @@ import { isMSField, convertMSFieldToLabel } from './complexChromatogram'; | ||
meta: {}, | ||
tmp: {}, // tmp information we need to keep for postprocessing | ||
}; | ||
@@ -267,5 +268,2 @@ parentEntry.children.push(currentEntry); | ||
} | ||
if (currentEntry.twoD) { | ||
currentEntry.yType = dataValue.split(ntuplesSeparatorRegExp)[0]; | ||
} | ||
} else if (canonicDataLabel === 'PAGE') { | ||
@@ -281,2 +279,6 @@ spectrum.page = dataValue.trim(); | ||
spectrum.sampleDescription = dataValue; | ||
} else if (canonicDataLabel.startsWith('$NUC')) { | ||
if (!currentEntry.tmp[canonicDataLabel] && !dataValue.includes('off')) { | ||
currentEntry.tmp[canonicDataLabel] = dataValue.replace(/[<>]/g, ''); | ||
} | ||
} else if (canonicDataLabel === 'END') { | ||
@@ -283,0 +285,0 @@ currentEntry = parentsStack.pop(); |
@@ -45,3 +45,4 @@ import add2D from './2d/add2D'; | ||
} | ||
delete entry.tmp; | ||
} | ||
} |
@@ -43,2 +43,17 @@ import { gyromagneticRatio } from 'nmr-processing'; | ||
// we will check if some nucleus are missing ... | ||
if (entry.ntuples && entry.ntuples.nucleus && entry.ntuples.symbol) { | ||
for (let i = 0; i < entry.ntuples.nucleus.length; i++) { | ||
let symbol = entry.ntuples.symbol[i]; | ||
let nucleus = entry.ntuples.nucleus[i]; | ||
if (symbol.startsWith('F') && !nucleus) { | ||
if (symbol === 'F1') entry.ntuples.nucleus[i] = entry.tmp.$NUC2; | ||
if (symbol === 'F2') entry.ntuples.nucleus[i] = entry.tmp.$NUC1; | ||
} | ||
if (symbol === 'F2') { | ||
entry.yType = entry.ntuples.nucleus[0]; | ||
} | ||
} | ||
} | ||
if ( | ||
@@ -45,0 +60,0 @@ observeFrequency && |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91444
2187
+ Addednmr-processing@0.5.0(transitive)
- Removedis-any-array@0.1.1(transitive)
- Removedml-gsd@5.0.2(transitive)
- Removedml-levenberg-marquardt@2.1.1(transitive)
- Removedml-optimize-lorentzian@0.2.0(transitive)
- Removedml-savitzky-golay-generalized@2.0.2(transitive)
- Removednmr-processing@0.3.1(transitive)
Updatednmr-processing@^0.5.0