Skip to content

Commit 01f862e

Browse files
committed
fix: update dependencies
1 parent 33e0519 commit 01f862e

File tree

4 files changed

+29
-36
lines changed

4 files changed

+29
-36
lines changed

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,32 +55,32 @@
5555
"trailingComma": "all"
5656
},
5757
"devDependencies": {
58-
"@babel/plugin-transform-modules-commonjs": "^7.17.9",
59-
"@babel/preset-typescript": "^7.16.7",
60-
"@types/jest": "^27.5.0",
58+
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
59+
"@babel/preset-typescript": "^7.21.0",
60+
"@types/jest": "^29.5.0",
6161
"chemcalc": "^3.4.1",
62-
"cheminfo-build": "^1.1.11",
63-
"eslint": "^8.14.0",
64-
"eslint-config-cheminfo-typescript": "^10.4.0",
65-
"eslint-plugin-jest": "^26.1.5",
62+
"cheminfo-build": "^1.2.0",
63+
"eslint": "^8.36.0",
64+
"eslint-config-cheminfo-typescript": "^11.3.1",
65+
"eslint-plugin-jest": "^27.2.1",
6666
"esm": "^3.2.25",
67-
"jest": "^28.1.0",
67+
"jest": "^29.5.0",
6868
"jest-matcher-deep-close-to": "^3.0.2",
69-
"mf-global": "^1.4.24",
69+
"mf-global": "^2.1.2",
7070
"ml-stat": "^1.3.3",
71-
"nodemon": "^2.0.16",
72-
"prettier": "^2.6.2",
73-
"rimraf": "^3.0.2",
74-
"spectrum-generator": "^8.0.1",
75-
"typescript": "^4.6.4",
76-
"xy-parser": "^5.0.2"
71+
"nodemon": "^2.0.22",
72+
"prettier": "^2.8.7",
73+
"rimraf": "^4.4.1",
74+
"spectrum-generator": "^8.0.6",
75+
"typescript": "^5.0.2",
76+
"xy-parser": "^5.0.4"
7777
},
7878
"dependencies": {
7979
"@lukeed/uuid": "^2.0.0",
80-
"cheminfo-types": "^1.1.0",
81-
"ml-peak-shape-generator": "^4.1.1",
80+
"cheminfo-types": "^1.4.0",
81+
"ml-peak-shape-generator": "^4.1.2",
8282
"ml-savitzky-golay-generalized": "^4.0.1",
83-
"ml-spectra-fitting": "^4.1.1",
84-
"ml-spectra-processing": "^11.6.0"
83+
"ml-spectra-fitting": "^4.2.1",
84+
"ml-spectra-processing": "^12.0.0"
8585
}
8686
}

src/gsd.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { DataXY } from 'cheminfo-types';
33
import { sgg, SGGOptions } from 'ml-savitzky-golay-generalized';
44
import {
55
xIsEquallySpaced,
6-
xIsMonotoneIncreasing,
6+
xIsMonotonic,
77
xMinValue,
88
xMaxValue,
99
xNoiseStandardDeviation,
@@ -71,7 +71,7 @@ export function gsd(data: DataXY, options: GSDOptions = {}): GSDPeakID[] {
7171
} = options;
7272

7373
let { x, y } = data;
74-
if (!xIsMonotoneIncreasing(x)) {
74+
if (xIsMonotonic(x) !== 1) {
7575
throw new Error('GSD only accepts monotone increasing x values');
7676
}
7777
//rescale;
@@ -92,13 +92,11 @@ export function gsd(data: DataXY, options: GSDOptions = {}): GSDPeakID[] {
9292
} else {
9393
noiseLevel = 0;
9494
}
95-
} else {
96-
if (maxCriteria === false) {
97-
noiseLevel *= -1;
98-
}
95+
} else if (!maxCriteria) {
96+
noiseLevel *= -1;
9997
}
10098

101-
if (maxCriteria === false) {
99+
if (!maxCriteria) {
102100
for (let i = 0; i < y.length; i++) {
103101
y[i] *= -1;
104102
}

src/post/broadenPeaks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ export function broadenPeaks<T extends GSDPeakOptionalShape>(
4848
let nextPeak = peaks[i + 1];
4949
if (peak.to.x > nextPeak.from.x) {
5050
// we do it proportional to the width of the peaks
51-
peak.to.x = nextPeak.from.x =
51+
peak.to.x =
5252
(peak.width / (nextPeak.width + peak.width)) * (nextPeak.x - peak.x) +
5353
peak.x;
54+
nextPeak.from.x = peak.to.x;
5455
}
5556
}
5657
}

src/utils/optimizeTop.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,22 @@ export function optimizeTop<T extends { index: number; x: number; y: number }>(
2020
y[currentIndex - 1] >= y[currentIndex]
2121
) {
2222
currentIndex--;
23-
} else {
24-
if (
23+
} else if (
2524
y[currentIndex + 1] >= y[currentIndex] &&
2625
y[currentIndex + 1] >= y[currentIndex + 2]
2726
) {
2827
currentIndex++;
29-
} else {
30-
if (
28+
} else if (
3129
y[currentIndex - 2] >= y[currentIndex - 3] &&
3230
y[currentIndex - 2] >= y[currentIndex - 1]
3331
) {
3432
currentIndex -= 2;
35-
} else {
36-
if (
33+
} else if (
3734
y[currentIndex + 2] >= y[currentIndex + 1] &&
3835
y[currentIndex + 2] >= y[currentIndex + 3]
3936
) {
4037
currentIndex += 2;
4138
}
42-
}
43-
}
44-
}
4539
// interpolation to a sin() function
4640
if (
4741
y[currentIndex - 1] > 0 &&

0 commit comments

Comments
 (0)