ml-spectra-fitting
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -32,3 +32,5 @@ import { getShape1D } from 'ml-peak-shape-generator'; | ||
// check if the property is specified in the peak | ||
let propertyValue = peak.parameters?.[parameter]?.[property]; | ||
let propertyValue = peak.parameters && | ||
peak.parameters[parameter] && | ||
peak.parameters[parameter][property]; | ||
if (propertyValue) { | ||
@@ -40,3 +42,5 @@ propertyValue = getNormalizedValue(propertyValue, parameter, property, minMaxY); | ||
// check if there are some global option, it could be a number or a callback | ||
let generalParameterValue = options.parameters?.[parameter]?.[property]; | ||
let generalParameterValue = options.parameters && | ||
options.parameters[parameter] && | ||
options.parameters[parameter][property]; | ||
if (generalParameterValue) { | ||
@@ -43,0 +47,0 @@ if (typeof generalParameterValue === 'number') { |
@@ -35,3 +35,5 @@ "use strict"; | ||
// check if the property is specified in the peak | ||
let propertyValue = peak.parameters?.[parameter]?.[property]; | ||
let propertyValue = peak.parameters && | ||
peak.parameters[parameter] && | ||
peak.parameters[parameter][property]; | ||
if (propertyValue) { | ||
@@ -43,3 +45,5 @@ propertyValue = getNormalizedValue(propertyValue, parameter, property, minMaxY); | ||
// check if there are some global option, it could be a number or a callback | ||
let generalParameterValue = options.parameters?.[parameter]?.[property]; | ||
let generalParameterValue = options.parameters && | ||
options.parameters[parameter] && | ||
options.parameters[parameter][property]; | ||
if (generalParameterValue) { | ||
@@ -46,0 +50,0 @@ if (typeof generalParameterValue === 'number') { |
{ | ||
"name": "ml-spectra-fitting", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Fit spectra using gaussian or lorentzian", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -106,3 +106,3 @@ import type { DataXY } from 'cheminfo-types'; | ||
expect(result.peaks[0].shape?.fwhm).toBeCloseTo(0.31, 4); | ||
expect(result.peaks[0].shape.fwhm).toBeCloseTo(0.31, 4); | ||
expect(result.peaks[0].x).toBeCloseTo(0, 5); | ||
@@ -109,0 +109,0 @@ expect(result.peaks[0].y).toBeCloseTo(0.001, 5); |
@@ -56,3 +56,6 @@ import { getShape1D, Shape1D, Shape1DInstance } from 'ml-peak-shape-generator'; | ||
// check if the property is specified in the peak | ||
let propertyValue = peak.parameters?.[parameter]?.[property]; | ||
let propertyValue = | ||
peak.parameters && | ||
peak.parameters[parameter] && | ||
peak.parameters[parameter][property]; | ||
if (propertyValue) { | ||
@@ -71,3 +74,6 @@ propertyValue = getNormalizedValue( | ||
let generalParameterValue = options.parameters?.[parameter]?.[property]; | ||
let generalParameterValue = | ||
options.parameters && | ||
options.parameters[parameter] && | ||
options.parameters[parameter][property]; | ||
if (generalParameterValue) { | ||
@@ -74,0 +80,0 @@ if (typeof generalParameterValue === 'number') { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
99712
1968