jcampconverter 11.0.2 → 11.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,715 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [11.0.1](https://github.com/cheminfo/jcampconverter/compare/v11.0.0...v11.0.1) (2025-02-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* use correct SPDX syntax for license ([86a647d](https://github.com/cheminfo/jcampconverter/commit/86a647d44cda56bbc9c0e950de9ec74651fa9f01))
|
|
9
|
+
|
|
10
|
+
## [11.0.0](https://github.com/cheminfo/jcampconverter/compare/v10.0.2...v11.0.0) (2025-02-14)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* update license to CC-BY-NC-SA-4.0 ([#131](https://github.com/cheminfo/jcampconverter/issues/131))
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* update license to CC-BY-NC-SA-4.0 ([#131](https://github.com/cheminfo/jcampconverter/issues/131)) ([f307306](https://github.com/cheminfo/jcampconverter/commit/f307306597520bbbcabe4b44521fa655946f9436))
|
|
20
|
+
|
|
21
|
+
## [10.0.2](https://github.com/cheminfo/jcampconverter/compare/v10.0.1...v10.0.2) (2025-02-03)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* export public types ([#128](https://github.com/cheminfo/jcampconverter/issues/128)) ([f9ba859](https://github.com/cheminfo/jcampconverter/commit/f9ba859a36ac485e7085af62c6ea0aa7ab6c9a84))
|
|
27
|
+
|
|
28
|
+
## [10.0.1](https://github.com/cheminfo/jcampconverter/compare/v10.0.0...v10.0.1) (2024-10-17)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* add removeComments option ([#125](https://github.com/cheminfo/jcampconverter/issues/125)) ([bdc3bc8](https://github.com/cheminfo/jcampconverter/commit/bdc3bc829ebc9d1c46a5375ed68a74c3f102e485))
|
|
34
|
+
|
|
35
|
+
## [10.0.0](https://github.com/cheminfo/jcampconverter/compare/v9.6.4...v10.0.0) (2024-10-17)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### ⚠ BREAKING CHANGES
|
|
39
|
+
|
|
40
|
+
* comments are being removed everywhere ([#124](https://github.com/cheminfo/jcampconverter/issues/124))
|
|
41
|
+
* remove prifiling. Same can be achieved using logger
|
|
42
|
+
* remove logs in convert result. More flexibility is proposed using the logger.
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* add logger in fastParseXYData ([64c1bdd](https://github.com/cheminfo/jcampconverter/commit/64c1bdd3d061174ab1583e4cb0c81d52d66ff5b8))
|
|
47
|
+
* comments are being removed everywhere ([#124](https://github.com/cheminfo/jcampconverter/issues/124)) ([116124d](https://github.com/cheminfo/jcampconverter/commit/116124dc0c097105bcc4c85516bbe5ae0aca131a))
|
|
48
|
+
* remove logs in convert result. More flexibility is proposed using the logger. ([8b68f31](https://github.com/cheminfo/jcampconverter/commit/8b68f31f4e8d9d29edaa54f0f4c469517b2db198))
|
|
49
|
+
* remove prifiling. Same can be achieved using logger ([88bab43](https://github.com/cheminfo/jcampconverter/commit/88bab4360995184612e6da1eed2e5e72d36f96b0))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* deal with ntuples missing page ([c5bcb26](https://github.com/cheminfo/jcampconverter/commit/c5bcb26cc6969abe36ba559fb40dced0f332d646))
|
|
55
|
+
|
|
56
|
+
## [9.6.4](https://github.com/cheminfo/jcampconverter/compare/v9.6.3...v9.6.4) (2024-03-22)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
* take care of units at the moment to calculate minY maxY ([#119](https://github.com/cheminfo/jcampconverter/issues/119)) ([3b4e03a](https://github.com/cheminfo/jcampconverter/commit/3b4e03ad212c7e855e1a823d05f6b53cfa711516))
|
|
62
|
+
|
|
63
|
+
## [9.6.3](https://github.com/cheminfo/jcampconverter/compare/v9.6.2...v9.6.3) (2024-03-07)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Bug Fixes
|
|
67
|
+
|
|
68
|
+
* do not consider JSON as an array ([0069da6](https://github.com/cheminfo/jcampconverter/commit/0069da6d7cb4fe891d0f5dd87d84c38029c9cf47))
|
|
69
|
+
|
|
70
|
+
## [9.6.2](https://github.com/cheminfo/jcampconverter/compare/v9.6.1...v9.6.2) (2024-03-07)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
* TS definition of Entry ([c1bb9bf](https://github.com/cheminfo/jcampconverter/commit/c1bb9bf458a7e4992fcb067432c9b7a800c2c457))
|
|
76
|
+
* update dependencies ([a5b59fa](https://github.com/cheminfo/jcampconverter/commit/a5b59fa4828e7f8201e0e5137f61d7a49fd26ff2))
|
|
77
|
+
|
|
78
|
+
## [9.6.1](https://github.com/cheminfo/jcampconverter/compare/v9.6.0...v9.6.1) (2024-02-01)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Bug Fixes
|
|
82
|
+
|
|
83
|
+
* convert vdlist to miliseconds number array ([#110](https://github.com/cheminfo/jcampconverter/issues/110)) ([0d54e75](https://github.com/cheminfo/jcampconverter/commit/0d54e7516660e280df553fdd98f887bdfe4a1ae9))
|
|
84
|
+
* do not try to convert to ppm if units is seconds for NMR 2D ([#113](https://github.com/cheminfo/jcampconverter/issues/113)) ([42cacbb](https://github.com/cheminfo/jcampconverter/commit/42cacbbc4d1b0c2f25855bb6459b75041ffd73b2))
|
|
85
|
+
|
|
86
|
+
## [9.6.0](https://github.com/cheminfo/jcampconverter/compare/v9.5.2...v9.6.0) (2024-01-08)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Features
|
|
90
|
+
|
|
91
|
+
* allow % as symbol for a variable and improve log message ([ff7e110](https://github.com/cheminfo/jcampconverter/commit/ff7e110017ee2be7f2df778a1477e5814b151d59))
|
|
92
|
+
|
|
93
|
+
## [9.5.2](https://github.com/cheminfo/jcampconverter/compare/v9.5.1...v9.5.2) (2024-01-08)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Bug Fixes
|
|
97
|
+
|
|
98
|
+
* avoid wrong length of parameter list ([#106](https://github.com/cheminfo/jcampconverter/issues/106)) ([4735f1e](https://github.com/cheminfo/jcampconverter/commit/4735f1eda3b1c24a8cd1c42b17f55031f6188826))
|
|
99
|
+
|
|
100
|
+
## [9.5.1](https://github.com/cheminfo/jcampconverter/compare/v9.5.0...v9.5.1) (2023-12-14)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### Bug Fixes
|
|
104
|
+
|
|
105
|
+
* **convertTo3DZ:** get first if array; ([#103](https://github.com/cheminfo/jcampconverter/issues/103)) ([935fce9](https://github.com/cheminfo/jcampconverter/commit/935fce9125c5ed47994a8e0536c54bcc9149ddf0))
|
|
106
|
+
|
|
107
|
+
## [9.5.0](https://github.com/cheminfo/jcampconverter/compare/v9.4.2...v9.5.0) (2023-11-22)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### Features
|
|
111
|
+
|
|
112
|
+
* expose a new method parseJcampCS ([8c6beed](https://github.com/cheminfo/jcampconverter/commit/8c6beed96a6e3681857e2c5bde8363ae9902a892))
|
|
113
|
+
* returns jcampDX and jcampCS properties in order to know the version of the JCAMP ([62ba992](https://github.com/cheminfo/jcampconverter/commit/62ba9927c41a917733451238fa83275626c783d3))
|
|
114
|
+
|
|
115
|
+
## [9.4.2](https://github.com/cheminfo/jcampconverter/compare/v9.4.1...v9.4.2) (2023-11-21)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Bug Fixes
|
|
119
|
+
|
|
120
|
+
* use getGyromagneticRation function ([#98](https://github.com/cheminfo/jcampconverter/issues/98)) ([f4e2392](https://github.com/cheminfo/jcampconverter/commit/f4e2392aff8502c344b0e3983ee4c85c508a54ce))
|
|
121
|
+
|
|
122
|
+
## [9.4.1](https://github.com/cheminfo/jcampconverter/compare/v9.4.0...v9.4.1) (2023-11-16)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Bug Fixes
|
|
126
|
+
|
|
127
|
+
* tree generation to keep empty lines ([#93](https://github.com/cheminfo/jcampconverter/issues/93)) ([2b3fe74](https://github.com/cheminfo/jcampconverter/commit/2b3fe74e23f76fe0add7edd0397539f3e28d8316))
|
|
128
|
+
|
|
129
|
+
## [9.4.0](https://github.com/cheminfo/jcampconverter/compare/v9.3.0...v9.4.0) (2023-11-14)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### Features
|
|
133
|
+
|
|
134
|
+
* add new convert option: noTrimRegExp ([187d4cf](https://github.com/cheminfo/jcampconverter/commit/187d4cf7c633e6c94471374ce2488030d41f0a5c))
|
|
135
|
+
|
|
136
|
+
## [9.3.0](https://github.com/cheminfo/jcampconverter/compare/v9.2.2...v9.3.0) (2023-11-13)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Features
|
|
140
|
+
|
|
141
|
+
* add debug logger to display the amount of spectra parsed ([30b4014](https://github.com/cheminfo/jcampconverter/commit/30b4014d1bc501bb264916531f481d8adfeba7d4))
|
|
142
|
+
|
|
143
|
+
## [9.2.2](https://github.com/cheminfo/jcampconverter/compare/v9.2.1...v9.2.2) (2023-10-04)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
### Bug Fixes
|
|
147
|
+
|
|
148
|
+
* remove caret symbol in nucleus 2D ([#86](https://github.com/cheminfo/jcampconverter/issues/86)) ([05b1d44](https://github.com/cheminfo/jcampconverter/commit/05b1d443fbddc8409dc37fe709e8ac2da9bd8f24))
|
|
149
|
+
|
|
150
|
+
## [9.2.1](https://github.com/cheminfo/jcampconverter/compare/v9.2.0...v9.2.1) (2023-10-02)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### Bug Fixes
|
|
154
|
+
|
|
155
|
+
* bundle and minify distributed code ([#85](https://github.com/cheminfo/jcampconverter/issues/85)) ([3528c36](https://github.com/cheminfo/jcampconverter/commit/3528c3675ee2be8ae533dbfd32fc251d2f0ab74a))
|
|
156
|
+
|
|
157
|
+
## [9.2.0](https://github.com/cheminfo/jcampconverter/compare/v9.1.1...v9.2.0) (2023-09-21)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
### Features
|
|
161
|
+
|
|
162
|
+
* expands array in meta information ([120bfb9](https://github.com/cheminfo/jcampconverter/commit/120bfb9723b465014e8a5ccd388f1a70be309711))
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### Documentation
|
|
166
|
+
|
|
167
|
+
* replace jcamp by JCAMP-DX ([d0e8ccb](https://github.com/cheminfo/jcampconverter/commit/d0e8ccb78b3f0b70eac28e3413d092b2c5506635))
|
|
168
|
+
|
|
169
|
+
## [9.1.1](https://github.com/cheminfo/jcampconverter/compare/v9.1.0...v9.1.1) (2023-05-10)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Bug Fixes
|
|
173
|
+
|
|
174
|
+
* add missing minMax optional property in convert result ([b76e834](https://github.com/cheminfo/jcampconverter/commit/b76e834ea1234dda0e01529bc4db374266ec56e9))
|
|
175
|
+
|
|
176
|
+
## [9.1.0](https://github.com/cheminfo/jcampconverter/compare/v9.0.7...v9.1.0) (2023-02-28)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
### Features
|
|
180
|
+
|
|
181
|
+
* principle of pino logging ([4be2278](https://github.com/cheminfo/jcampconverter/commit/4be227885a55508fbe469b6810609ef921449954))
|
|
182
|
+
* test implementation of a logger ([5acb174](https://github.com/cheminfo/jcampconverter/commit/5acb174074451e470645fac2229f40d951646360))
|
|
183
|
+
|
|
184
|
+
## [9.0.7](https://github.com/cheminfo/jcampconverter/compare/v9.0.6...v9.0.7) (2023-02-02)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Bug Fixes
|
|
188
|
+
|
|
189
|
+
* T[1-2] symbol supported in postProcessingNMR ([#79](https://github.com/cheminfo/jcampconverter/issues/79)) ([eeca92c](https://github.com/cheminfo/jcampconverter/commit/eeca92c61eb002b7d96076247de5479b51c2f3be))
|
|
190
|
+
|
|
191
|
+
## [9.0.6](https://github.com/cheminfo/jcampconverter/compare/v9.0.5...v9.0.6) (2022-12-16)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Bug Fixes
|
|
195
|
+
|
|
196
|
+
* only shift FT nmr data ([#76](https://github.com/cheminfo/jcampconverter/issues/76)) ([7d61215](https://github.com/cheminfo/jcampconverter/commit/7d6121593feb0b8d6d2014685dc8641da6356cb4))
|
|
197
|
+
|
|
198
|
+
## [9.0.5](https://github.com/cheminfo/jcampconverter/compare/v9.0.4...v9.0.5) (2022-11-28)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
### Documentation
|
|
202
|
+
|
|
203
|
+
* improve documentation ([e32ea06](https://github.com/cheminfo/jcampconverter/commit/e32ea068e319149f9461ac8ade159568faf11cbe))
|
|
204
|
+
|
|
205
|
+
## [9.0.4](https://github.com/cheminfo/jcampconverter/compare/v9.0.3...v9.0.4) (2022-11-25)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### Bug Fixes
|
|
209
|
+
|
|
210
|
+
* add dataClass to tree ([#72](https://github.com/cheminfo/jcampconverter/issues/72)) ([02e59cd](https://github.com/cheminfo/jcampconverter/commit/02e59cd2d09e7a6f30663e9865d4594fe0fd8d59))
|
|
211
|
+
|
|
212
|
+
## [9.0.3](https://github.com/cheminfo/jcampconverter/compare/v9.0.2...v9.0.3) (2022-11-14)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
### Bug Fixes
|
|
216
|
+
|
|
217
|
+
* assignment parsing ([7864ac1](https://github.com/cheminfo/jcampconverter/commit/7864ac169c0e9af37c8b7cd96de722391e6d12f4))
|
|
218
|
+
|
|
219
|
+
## [9.0.2](https://github.com/cheminfo/jcampconverter/compare/v9.0.1...v9.0.2) (2022-06-23)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
### Bug Fixes
|
|
223
|
+
|
|
224
|
+
* add info property in typescript definition ([b0c6195](https://github.com/cheminfo/jcampconverter/commit/b0c61954ce2566a270da8c0499796a634389aee4))
|
|
225
|
+
|
|
226
|
+
### [9.0.1](https://github.com/cheminfo/jcampconverter/compare/v9.0.0...v9.0.1) (2022-05-04)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
### Bug Fixes
|
|
230
|
+
|
|
231
|
+
* remove dependency of nmr-processing ([0810359](https://github.com/cheminfo/jcampconverter/commit/0810359c1090be86aeaee8a5042ec23c3cb5eb30))
|
|
232
|
+
|
|
233
|
+
## [9.0.0](https://github.com/cheminfo/jcampconverter/compare/v8.5.0...v9.0.0) (2022-05-04)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
### ⚠ BREAKING CHANGES
|
|
237
|
+
|
|
238
|
+
* drop support for Node.js 12
|
|
239
|
+
|
|
240
|
+
### Bug Fixes
|
|
241
|
+
|
|
242
|
+
* update dependencies ([7e7bf36](https://github.com/cheminfo/jcampconverter/commit/7e7bf36c50b28842c683a09f07fe1d37fc417db9))
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
### Miscellaneous Chores
|
|
246
|
+
|
|
247
|
+
* drop support for Node.js 12 ([47ac38c](https://github.com/cheminfo/jcampconverter/commit/47ac38c218afc5da2390a1efe554f78fa8ce73c9))
|
|
248
|
+
|
|
249
|
+
## [8.5.0](https://github.com/cheminfo/jcampconverter/compare/v8.4.0...v8.5.0) (2022-04-21)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
### Features
|
|
253
|
+
|
|
254
|
+
* add CITATION.cff ([8b19a03](https://github.com/cheminfo/jcampconverter/commit/8b19a03d12a67e345f46c3935158e3be5acd3046))
|
|
255
|
+
|
|
256
|
+
## [8.4.0](https://github.com/cheminfo/jcampconverter/compare/v8.3.0...v8.4.0) (2022-04-19)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
### Features
|
|
260
|
+
|
|
261
|
+
* add zenodo meta information ([77192a0](https://github.com/cheminfo/jcampconverter/commit/77192a0f66195923e35851e9ecedfc0d1d1436cb))
|
|
262
|
+
|
|
263
|
+
## [8.3.0](https://github.com/cheminfo/jcampconverter/compare/v8.2.5...v8.3.0) (2022-03-21)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
### Features
|
|
267
|
+
|
|
268
|
+
* allow parsing even if NBPOINTS is not specified ([91cfe35](https://github.com/cheminfo/jcampconverter/commit/91cfe35543679b4b4310ff9f2d3f9d7692e69572))
|
|
269
|
+
|
|
270
|
+
### [8.2.5](https://www.github.com/cheminfo/jcampconverter/compare/v8.2.4...v8.2.5) (2022-02-25)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
### Bug Fixes
|
|
274
|
+
|
|
275
|
+
* update dependencies ([23df1d0](https://www.github.com/cheminfo/jcampconverter/commit/23df1d0efd55543729bc9435f1a8541ddc929875))
|
|
276
|
+
|
|
277
|
+
### [8.2.4](https://www.github.com/cheminfo/jcampconverter/compare/v8.2.3...v8.2.4) (2021-12-15)
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
### Bug Fixes
|
|
281
|
+
|
|
282
|
+
* correct definition of Spectrum ([be0b2e8](https://www.github.com/cheminfo/jcampconverter/commit/be0b2e823ae6efb588f758196cc7ab0d4b2b70c0))
|
|
283
|
+
|
|
284
|
+
### [8.2.3](https://www.github.com/cheminfo/jcampconverter/compare/v8.2.2...v8.2.3) (2021-12-15)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
### Bug Fixes
|
|
288
|
+
|
|
289
|
+
* update dependencies to remove circular dependency with ml-gsd ([fac049c](https://www.github.com/cheminfo/jcampconverter/commit/fac049c8054ad78750147f36a697554df3725684))
|
|
290
|
+
|
|
291
|
+
### [8.2.2](https://www.github.com/cheminfo/jcampconverter/compare/v8.2.1...v8.2.2) (2021-11-05)
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
### Bug Fixes
|
|
295
|
+
|
|
296
|
+
* replace parseFloat by Number ([e65c194](https://www.github.com/cheminfo/jcampconverter/commit/e65c19483e8c429d73e540614e7e020cdd660e0b))
|
|
297
|
+
|
|
298
|
+
### [8.2.1](https://www.github.com/cheminfo/jcampconverter/compare/v8.2.0...v8.2.1) (2021-09-30)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
### Bug Fixes
|
|
302
|
+
|
|
303
|
+
* ensure compatibility with node 12 ([c5c68cc](https://www.github.com/cheminfo/jcampconverter/commit/c5c68cc9de6330088f7c838573369c280ba68ff6))
|
|
304
|
+
* update nmr-processing library ([0732b3a](https://www.github.com/cheminfo/jcampconverter/commit/0732b3a44fd9bd92a721f6694bb98e46d12ea7bd))
|
|
305
|
+
|
|
306
|
+
## [8.2.0](https://www.github.com/cheminfo/jcampconverter/compare/v8.1.5...v8.2.0) (2021-09-07)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
### Features
|
|
310
|
+
|
|
311
|
+
* use dynamic-typing package and parse hexadecimal values ([0b584f3](https://www.github.com/cheminfo/jcampconverter/commit/0b584f37b3b5dadbcb9b77ec40124ef5cb0a0af7))
|
|
312
|
+
|
|
313
|
+
### [8.1.5](https://www.github.com/cheminfo/jcampconverter/compare/v8.1.4...v8.1.5) (2021-07-29)
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
### Bug Fixes
|
|
317
|
+
|
|
318
|
+
* update dependencies ([602f123](https://www.github.com/cheminfo/jcampconverter/commit/602f123e8b0053e5b53bbbcf032122ce1ed82f0d))
|
|
319
|
+
|
|
320
|
+
### [8.1.4](https://www.github.com/cheminfo/jcampconverter/compare/v8.1.3...v8.1.4) (2021-07-12)
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
### Bug Fixes
|
|
324
|
+
|
|
325
|
+
* reelase for Zenodo DOI ([973ed64](https://www.github.com/cheminfo/jcampconverter/commit/973ed64d3be6fb1ec1c4830a791b9ee901479f67))
|
|
326
|
+
|
|
327
|
+
### [8.1.3](https://www.github.com/cheminfo/jcampconverter/compare/v8.1.2...v8.1.3) (2021-06-18)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
### Bug Fixes
|
|
331
|
+
|
|
332
|
+
* prevent isNaN with dynamicTyping ([c171dcf](https://www.github.com/cheminfo/jcampconverter/commit/c171dcf0c1f9891bf85435c6693aec9c54a98c01))
|
|
333
|
+
|
|
334
|
+
### [8.1.2](https://www.github.com/cheminfo/jcampconverter/compare/v8.1.1...v8.1.2) (2021-05-27)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
### Bug Fixes
|
|
338
|
+
|
|
339
|
+
* more selective to generate 2D ([ee81f1f](https://www.github.com/cheminfo/jcampconverter/commit/ee81f1f2be91411c2dd8f9324c19405aa582b7c9))
|
|
340
|
+
|
|
341
|
+
### [8.1.1](https://www.github.com/cheminfo/jcampconverter/compare/v8.1.0...v8.1.1) (2021-05-06)
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
### Bug Fixes
|
|
345
|
+
|
|
346
|
+
* bug in linked spectra and reference ([ec63494](https://www.github.com/cheminfo/jcampconverter/commit/ec63494433b865dc3ed7589763d32afbbc1d2c60))
|
|
347
|
+
|
|
348
|
+
## [8.1.0](https://www.github.com/cheminfo/jcampconverter/compare/v8.0.2...v8.1.0) (2021-05-05)
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
### Features
|
|
352
|
+
|
|
353
|
+
* remove the cheminfo hack that was parsing cheminfo meta ([1fe8dd5](https://www.github.com/cheminfo/jcampconverter/commit/1fe8dd51c97a98c65818c4f4af712d6c377969e0))
|
|
354
|
+
|
|
355
|
+
### [8.0.2](https://www.github.com/cheminfo/jcampconverter/compare/v8.0.1...v8.0.2) (2021-04-28)
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
### Bug Fixes
|
|
359
|
+
|
|
360
|
+
* update ensure-text library ([fbda58e](https://www.github.com/cheminfo/jcampconverter/commit/fbda58eee6fc127141930e9c160b468ddeedf23b))
|
|
361
|
+
|
|
362
|
+
### [8.0.1](https://www.github.com/cheminfo/jcampconverter/compare/v8.0.0...v8.0.1) (2021-04-28)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
### Bug Fixes
|
|
366
|
+
|
|
367
|
+
* noesy without nucleus ([eb9a7b7](https://www.github.com/cheminfo/jcampconverter/commit/eb9a7b7faf13dfa52e1c78b7ec638efcf18ee364))
|
|
368
|
+
|
|
369
|
+
## [8.0.0](https://www.github.com/cheminfo/jcampconverter/compare/v7.10.0...v8.0.0) (2021-04-27)
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
### ⚠ BREAKING CHANGES
|
|
373
|
+
|
|
374
|
+
* matrix for node CI 12, 14 and 16 and remove node 10 support
|
|
375
|
+
|
|
376
|
+
### Features
|
|
377
|
+
|
|
378
|
+
* jcamp may also be an ArrayBuffer and not only a string ([58b2a38](https://www.github.com/cheminfo/jcampconverter/commit/58b2a3813b8b368d4f72f13f65f086b1f321ce43))
|
|
379
|
+
|
|
380
|
+
## [7.10.0](https://www.github.com/cheminfo/jcampconverter/compare/v7.9.0...v7.10.0) (2021-04-27)
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
### Features
|
|
384
|
+
|
|
385
|
+
* If ##$cheminfo LDR, parsed the value as a JSON ([2c65658](https://www.github.com/cheminfo/jcampconverter/commit/2c65658331103f4552ffa7def310e695911424c3))
|
|
386
|
+
|
|
387
|
+
## [7.8.0](https://www.github.com/cheminfo/jcampconverter/compare/v7.7.0...v7.8.0) (2021-03-24)
|
|
388
|
+
|
|
389
|
+
### Features
|
|
390
|
+
|
|
391
|
+
* improve 2D noise detection by using the full 2D spectrum ([7607af3](https://www.github.com/cheminfo/jcampconverter/commit/7607af3940945d9e794bf926a09e2e90b4d9efdf))
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
### Bug Fixes
|
|
395
|
+
|
|
396
|
+
* update dependencies and readme ([65d11ec](https://www.github.com/cheminfo/jcampconverter/commit/65d11eca3b79ff84f28a0e48e7270fbc24242ae1))
|
|
397
|
+
|
|
398
|
+
## [7.7.0](https://www.github.com/cheminfo/jcampconverter/compare/v7.6.6...v7.7.0) (2021-02-10)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
### Features
|
|
402
|
+
|
|
403
|
+
* ignore deltaX and calculate firstX-lastX / npoints ([8aff051](https://www.github.com/cheminfo/jcampconverter/commit/8aff051d7c095933e0f01ae171801a871a1e27cf))
|
|
404
|
+
|
|
405
|
+
### [7.6.6](https://www.github.com/cheminfo/jcampconverter/compare/v7.6.5...v7.6.6) (2021-01-18)
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
### Bug Fixes
|
|
409
|
+
|
|
410
|
+
* deal with 2D jcamp without all .nucleus ([3cf7cc0](https://www.github.com/cheminfo/jcampconverter/commit/3cf7cc0907866505f430f4cf359d3b6e0f711878))
|
|
411
|
+
|
|
412
|
+
### [7.6.5](https://www.github.com/cheminfo/jcampconverter/compare/v7.6.4...v7.6.5) (2020-10-27)
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
### Bug Fixes
|
|
416
|
+
|
|
417
|
+
* correct dynamic typing ([bdd061f](https://www.github.com/cheminfo/jcampconverter/commit/bdd061ff2fc2c905122ba0bb677891b47265c527))
|
|
418
|
+
|
|
419
|
+
### [7.6.4](https://www.github.com/cheminfo/jcampconverter/compare/v7.6.3...v7.6.4) (2020-10-27)
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
### Bug Fixes
|
|
423
|
+
|
|
424
|
+
* nmr-processing dependency ([797bc76](https://www.github.com/cheminfo/jcampconverter/commit/797bc767cc129ec6bdf16f74635cd2bd6fc28a41))
|
|
425
|
+
|
|
426
|
+
### [7.6.3](https://www.github.com/cheminfo/jcampconverter/compare/v7.6.2...v7.6.3) (2020-10-14)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
### Bug Fixes
|
|
430
|
+
|
|
431
|
+
* remove worker from documentation ([9c47fe3](https://www.github.com/cheminfo/jcampconverter/commit/9c47fe31a7d3944fb17c01677f6e58be679cc474))
|
|
432
|
+
|
|
433
|
+
### [7.6.2](https://github.com/cheminfo/jcampconverter/compare/v7.6.1...v7.6.2) (2020-10-14)
|
|
434
|
+
|
|
435
|
+
## [7.3.1](https://github.com/cheminfo/jcampconverter/compare/v7.2.0...v7.3.1) (2020-06-24)
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
### Bug Fixes
|
|
439
|
+
|
|
440
|
+
* variables has always lowercase property ([32bc505](https://github.com/cheminfo/jcampconverter/commit/32bc505c61645430270b2a0eb09e7bff01460bf6))
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
### Features
|
|
444
|
+
|
|
445
|
+
* add data in variables ([dcd2966](https://github.com/cheminfo/jcampconverter/commit/dcd2966ed0de32e6e63207593c1a52bdc5986e49))
|
|
446
|
+
* apply NMR conversion to ppm as a postProcessing process ([dcd0ea9](https://github.com/cheminfo/jcampconverter/commit/dcd0ea96b63241afb11ffc5dea779571c4e4650b))
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
# [7.2.0](https://github.com/cheminfo/jcampconverter/compare/v7.1.0...v7.2.0) (2020-06-20)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
### Features
|
|
454
|
+
|
|
455
|
+
* change xUnits for ntuples to add varname + unit ([92eae09](https://github.com/cheminfo/jcampconverter/commit/92eae094aedaf911a5437c8578a76679d6bb3ae9))
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
# [7.1.0](https://github.com/cheminfo/jcampconverter/compare/v7.0.0...v7.1.0) (2020-06-11)
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
### Bug Fixes
|
|
463
|
+
|
|
464
|
+
* rename xUnit and yUnit to xUnits and yUnits ([d50c6fe](https://github.com/cheminfo/jcampconverter/commit/d50c6feb0db96e2bd10bdae70b6fead0b30ea1c3))
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
### BREAKING CHANGES
|
|
468
|
+
|
|
469
|
+
* In the returned value the variables has been
|
|
470
|
+
renamed to xUnits and yUnits to keep the LDR of
|
|
471
|
+
the jcamp
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
# [7.0.0](https://github.com/cheminfo/jcampconverter/compare/v6.0.1...v7.0.0) (2020-06-11)
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
## [6.0.1](https://github.com/cheminfo/jcampconverter/compare/v6.0.0...v6.0.1) (2020-06-10)
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
### Bug Fixes
|
|
483
|
+
|
|
484
|
+
* improve 2d spectra discovery ([5a7c15a](https://github.com/cheminfo/jcampconverter/commit/5a7c15afbadb133d3ecb89d5e816354c0d207441))
|
|
485
|
+
* improve detection of 2d spectra ([02e966f](https://github.com/cheminfo/jcampconverter/commit/02e966f108578578fe717d259b16a7c933a0db44))
|
|
486
|
+
* ntuples separator must contain a comma ([3bbf182](https://github.com/cheminfo/jcampconverter/commit/3bbf1829acffeeed4a888fd502afdd6637d070b8))
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
# [6.0.0](https://github.com/cheminfo/jcampconverter/compare/v5.0.2...v6.0.0) (2020-06-10)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
### Features
|
|
494
|
+
|
|
495
|
+
* add parsing of multivariable NTUPLE PEAKS ([872a43f](https://github.com/cheminfo/jcampconverter/commit/872a43fa9867b84247138bd939cd455c386e7e46))
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
## [5.0.2](https://github.com/cheminfo/jcampconverter/compare/v5.0.1...v5.0.2) (2020-04-08)
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
## [5.0.1](https://github.com/cheminfo/jcampconverter/compare/v5.0.0...v5.0.1) (2020-04-04)
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
### Bug Fixes
|
|
507
|
+
|
|
508
|
+
* 2d matrix minX / maxX ([447606d](https://github.com/cheminfo/jcampconverter/commit/447606df8a952d3c19dec3306d8aa2f09ee402b0))
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
# [5.0.0](https://github.com/cheminfo/jcampconverter/compare/v4.1.1...v5.0.0) (2020-04-04)
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
### Bug Fixes
|
|
516
|
+
|
|
517
|
+
* rollup and build ([eef5d66](https://github.com/cheminfo/jcampconverter/commit/eef5d66dbeccdfd907dc86ce1cd8aa1429a544f3))
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
## [4.1.1](https://github.com/cheminfo/jcampconverter/compare/v4.1.0...v4.1.1) (2020-04-02)
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
### Bug Fixes
|
|
525
|
+
|
|
526
|
+
* allow jcamp with no data ([4365d79](https://github.com/cheminfo/jcampconverter/commit/4365d79b16fa6f1651e6a2d4a1626107d0072e8a))
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
## [2.10.2](https://github.com/cheminfo/jcampconverter/compare/v2.10.1...v2.10.2) (2018-11-23)
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
<a name="2.9.1"></a>
|
|
535
|
+
## [2.9.1](https://github.com/cheminfo/jcampconverter/compare/v2.9.0...v2.9.1) (2017-10-19)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
<a name="2.9.0"></a>
|
|
540
|
+
# [2.9.0](https://github.com/cheminfo/jcampconverter/compare/v2.8.0...v2.9.0) (2017-09-13)
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
### Features
|
|
544
|
+
|
|
545
|
+
* read mestrec file ([5e485f2](https://github.com/cheminfo/jcampconverter/commit/5e485f2))
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
<a name="2.8.0"></a>
|
|
550
|
+
# [2.8.0](https://github.com/cheminfo/jcampconverter/compare/v2.7.0...v2.8.0) (2017-08-09)
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
### Features
|
|
554
|
+
|
|
555
|
+
* change newGCMS to chromatogram ([1941f48](https://github.com/cheminfo/jcampconverter/commit/1941f48))
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
<a name="2.7.0"></a>
|
|
560
|
+
# [2.7.0](https://github.com/cheminfo/jcampconverter/compare/v2.6.0...v2.7.0) (2016-09-15)
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
<a name="2.6.0"></a>
|
|
565
|
+
# [2.6.0](https://github.com/cheminfo/jcampconverter/compare/v2.5.1...v2.6.0) (2016-07-11)
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
### Features
|
|
569
|
+
|
|
570
|
+
* add noContour option ([ab5ff6b](https://github.com/cheminfo/jcampconverter/commit/ab5ff6b))
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
<a name="2.5.1"></a>
|
|
575
|
+
## [2.5.1](https://github.com/cheminfo/jcampconverter/compare/v2.5.0...v2.5.1) (2016-06-27)
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
### Bug Fixes
|
|
579
|
+
|
|
580
|
+
* more wantXY checks ([c87a97d](https://github.com/cheminfo/jcampconverter/commit/c87a97d))
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
<a name="2.5.0"></a>
|
|
585
|
+
# [2.5.0](https://github.com/cheminfo/jcampconverter/compare/v2.4.5...v2.5.0) (2016-06-27)
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
<a name="2.4.5"></a>
|
|
590
|
+
## [2.4.5](https://github.com/cheminfo/jcampconverter/compare/v2.4.4...v2.4.5) (2016-05-06)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
<a name="2.4.4"></a>
|
|
595
|
+
## [2.4.4](https://github.com/cheminfo/jcampconverter/compare/v2.4.3...v2.4.4) (2016-05-06)
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
<a name="2.4.3"></a>
|
|
600
|
+
## [2.4.3](https://github.com/cheminfo/jcampconverter/compare/v2.4.2...v2.4.3) (2016-05-04)
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
<a name="2.4.2"></a>
|
|
605
|
+
## [2.4.2](https://github.com/cheminfo/jcampconverter/compare/v2.4.1...v2.4.2) (2016-05-04)
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
<a name="2.4.1"></a>
|
|
610
|
+
## [2.4.1](https://github.com/cheminfo/jcampconverter/compare/v2.4.0...v2.4.1) (2016-05-04)
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
<a name="2.4.0"></a>
|
|
615
|
+
# [2.4.0](https://github.com/cheminfo/jcampconverter/compare/v2.3.0...v2.4.0) (2016-05-04)
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
<a name="2.3.0"></a>
|
|
620
|
+
# [2.3.0](https://github.com/cheminfo/jcampconverter/compare/v2.2.2...v2.3.0) (2016-03-14)
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
<a name="2.2.2"></a>
|
|
625
|
+
## [2.2.2](https://github.com/cheminfo/jcampconverter/compare/v2.2.1...v2.2.2) (2016-03-07)
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
<a name="2.2.1"></a>
|
|
630
|
+
## [2.2.1](https://github.com/cheminfo/jcampconverter/compare/v2.2.0...v2.2.1) (2016-03-04)
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
<a name="2.2.0"></a>
|
|
635
|
+
# [2.2.0](https://github.com/cheminfo/jcampconverter/compare/v2.1.0...v2.2.0) (2016-02-25)
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
<a name="2.1.0"></a>
|
|
640
|
+
# [2.1.0](https://github.com/cheminfo/jcampconverter/compare/v2.0.9...v2.1.0) (2015-07-21)
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
<a name="2.0.9"></a>
|
|
645
|
+
## [2.0.9](https://github.com/cheminfo/jcampconverter/compare/v2.0.8...v2.0.9) (2015-05-29)
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
<a name="2.0.8"></a>
|
|
650
|
+
## [2.0.8](https://github.com/cheminfo/jcampconverter/compare/v2.0.7...v2.0.8) (2015-03-10)
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
<a name="2.0.7"></a>
|
|
655
|
+
## [2.0.7](https://github.com/cheminfo/jcampconverter/compare/v2.0.6...v2.0.7) (2015-03-06)
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
<a name="2.0.6"></a>
|
|
660
|
+
## [2.0.6](https://github.com/cheminfo/jcampconverter/compare/v2.0.5...v2.0.6) (2015-03-05)
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
<a name="2.0.5"></a>
|
|
665
|
+
## [2.0.5](https://github.com/cheminfo/jcampconverter/compare/v2.0.4...v2.0.5) (2015-02-19)
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
<a name="2.0.4"></a>
|
|
670
|
+
## [2.0.4](https://github.com/cheminfo/jcampconverter/compare/v2.0.3...v2.0.4) (2015-02-10)
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
<a name="2.0.3"></a>
|
|
675
|
+
## [2.0.3](https://github.com/cheminfo/jcampconverter/compare/v2.0.2...v2.0.3) (2015-01-23)
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
<a name="2.0.2"></a>
|
|
680
|
+
## [2.0.2](https://github.com/cheminfo/jcampconverter/compare/v2.0.1...v2.0.2) (2015-01-23)
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
<a name="2.0.1"></a>
|
|
685
|
+
## [2.0.1](https://github.com/cheminfo/jcampconverter/compare/v2.0.0...v2.0.1) (2014-10-20)
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
<a name="2.0.0"></a>
|
|
690
|
+
# [2.0.0](https://github.com/cheminfo/jcampconverter/compare/v1.0.4...v2.0.0) (2014-10-20)
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
<a name="1.0.4"></a>
|
|
695
|
+
## [1.0.4](https://github.com/cheminfo/jcampconverter/compare/v1.0.3...v1.0.4) (2014-10-16)
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
<a name="1.0.3"></a>
|
|
700
|
+
## [1.0.3](https://github.com/cheminfo/jcampconverter/compare/v1.0.2...v1.0.3) (2014-10-06)
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
<a name="1.0.2"></a>
|
|
705
|
+
## [1.0.2](https://github.com/cheminfo/jcampconverter/compare/v1.0.1...v1.0.2) (2014-10-06)
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
<a name="1.0.1"></a>
|
|
710
|
+
## [1.0.1](https://github.com/cheminfo/jcampconverter/compare/v1.0.0...v1.0.1) (2014-10-06)
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
<a name="1.0.0"></a>
|
|
715
|
+
# 1.0.0 (2014-10-06)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jcampconverter",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.3",
|
|
4
4
|
"description": "Parse and convert JCAMP-DX data",
|
|
5
5
|
"license": "CC-BY-NC-SA-4.0",
|
|
6
6
|
"type": "module",
|
|
@@ -8,73 +8,53 @@
|
|
|
8
8
|
"jcamp",
|
|
9
9
|
"converter"
|
|
10
10
|
],
|
|
11
|
-
"types": "./jcampconverter.d.ts",
|
|
12
|
-
"require": "./jcampconverter.cjs",
|
|
13
|
-
"module": "./jcampconverter.mjs",
|
|
14
11
|
"exports": {
|
|
15
12
|
".": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"default": "./jcampconverter.mjs"
|
|
13
|
+
"nmrium-internal": "./src/index.ts",
|
|
14
|
+
"default": "./dist/jcampconverter.js"
|
|
19
15
|
}
|
|
20
16
|
},
|
|
21
17
|
"files": [
|
|
22
|
-
"
|
|
23
|
-
"jcampconverter.cjs",
|
|
24
|
-
"jcampconverter.mjs"
|
|
18
|
+
"dist"
|
|
25
19
|
],
|
|
26
20
|
"scripts": {
|
|
27
|
-
"api-extractor": "api-extractor run --local",
|
|
28
21
|
"benchmark": "node benchmark/benchmark.js",
|
|
29
22
|
"build": "tsc --project tsconfig.cheminfo-build.json && cheminfo-build --entry lib/index.js --root JcampConverter --no-source-map && rm dist/jcampconverter.js",
|
|
30
|
-
"bundle": "npm run bundle-
|
|
31
|
-
"bundle-
|
|
32
|
-
"bundle-
|
|
33
|
-
"
|
|
34
|
-
"bundle-types": "npm run tsc && npm run api-extractor",
|
|
35
|
-
"check-types": "tsc --noEmit",
|
|
36
|
-
"clean": "rimraf dist lib types",
|
|
23
|
+
"bundle": "npm run bundle-esm && npm run bundle-types",
|
|
24
|
+
"bundle-esm": "esbuild src/index.ts --bundle --packages=external --minify --format=esm --outfile=dist/jcampconverter.js",
|
|
25
|
+
"bundle-types": "npm run tsc && yarn g:api-extractor",
|
|
26
|
+
"clean": "rimraf dist types",
|
|
37
27
|
"deopt": "node --trace-opt --trace-deopt --code-comments debug/deoptimize.js > deopt.log",
|
|
38
28
|
"hydra": "node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm debug/deoptimize.js",
|
|
39
|
-
"eslint": "eslint src __tests__",
|
|
40
|
-
"eslint-fix": "npm run eslint -- --fix",
|
|
41
29
|
"jscpd": "jscpd -l 10 -i \"**/__tests__/**\" -t 1 src",
|
|
42
|
-
"prepack": "npm run bundle
|
|
43
|
-
"
|
|
44
|
-
"prettier-write": "prettier --write src __tests__",
|
|
45
|
-
"test": "npm run test-only && npm run check-types && npm run eslint && npm run prettier",
|
|
46
|
-
"test-only": "vitest run --coverage",
|
|
30
|
+
"prepack": "npm run bundle",
|
|
31
|
+
"test": "yarn g:test-only && yarn g:check-types && yarn g:eslint && yarn g:prettier",
|
|
47
32
|
"tsc": "tsc --project tsconfig.types.json"
|
|
48
33
|
},
|
|
49
34
|
"bugs": {
|
|
50
35
|
"url": "https://github.com/cheminfo/nmrium/issues/new?title=%5Bjcampconverter%5D"
|
|
51
36
|
},
|
|
52
37
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.50.0",
|
|
54
|
-
"@types/node": "^22.13.1",
|
|
55
|
-
"@vitest/coverage-istanbul": "^3.0.5",
|
|
56
38
|
"benchmark": "^2.1.4",
|
|
57
39
|
"cheminfo-build": "^1.2.1",
|
|
58
|
-
"esbuild": "^0.25.
|
|
59
|
-
"eslint": "^9.20.1",
|
|
60
|
-
"eslint-config-cheminfo-typescript": "^17.0.0",
|
|
40
|
+
"esbuild": "^0.25.5",
|
|
61
41
|
"fifo-logger": "^1.0.0",
|
|
62
|
-
"
|
|
63
|
-
"jcamp-data-test": "^0.8.2",
|
|
42
|
+
"jcamp-data-test": "^1.0.0",
|
|
64
43
|
"jest-matcher-deep-close-to": "^3.0.2",
|
|
65
44
|
"jscpd": "^4.0.5",
|
|
66
|
-
"ml-spectra-processing": "^14.
|
|
67
|
-
"openchemlib": "^8.18.1",
|
|
68
|
-
"prettier": "^3.5.0",
|
|
45
|
+
"ml-spectra-processing": "^14.12.0",
|
|
69
46
|
"rimraf": "^6.0.1",
|
|
70
|
-
"
|
|
71
|
-
"vitest": "^3.0.5"
|
|
47
|
+
"vitest": "^3.1.4"
|
|
72
48
|
},
|
|
73
49
|
"dependencies": {
|
|
74
50
|
"cheminfo-types": "^1.8.1",
|
|
75
51
|
"dynamic-typing": "^1.0.1",
|
|
76
52
|
"ensure-string": "^1.2.0",
|
|
77
53
|
"gyromagnetic-ratio": "^2.0.0",
|
|
78
|
-
"ml-array-median": "^1.1.6"
|
|
54
|
+
"ml-array-median": "^1.1.6",
|
|
55
|
+
"openchemlib": "^9.2.0"
|
|
56
|
+
},
|
|
57
|
+
"volta": {
|
|
58
|
+
"extends": "../../../package.json"
|
|
79
59
|
}
|
|
80
|
-
}
|
|
60
|
+
}
|
package/jcampconverter.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";var de=Object.create;var $=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty;var xe=(e,f)=>{for(var t in f)$(e,t,{get:f[t],enumerable:!0})},oe=(e,f,t,s)=>{if(f&&typeof f=="object"||typeof f=="function")for(let a of ge(f))!ye.call(e,a)&&a!==t&&$(e,a,{get:()=>f[a],enumerable:!(s=be(f,a))||s.enumerable});return e};var Ce=(e,f,t)=>(t=e!=null?de(he(e)):{},oe(f||!e||!e.__esModule?$(t,"default",{value:e,enumerable:!0}):t,e)),Ae=e=>oe($({},"__esModule",{value:!0}),e);var $e={};xe($e,{convert:()=>Oe,createTree:()=>Ne,parseJcampCS:()=>Me});module.exports=Ae($e);var se=require("ensure-string");var P=/\s*\$\$.*/;function M(e){return e.replace(P,"")}function Ne(e,f={}){e=(0,se.ensureString)(e);let{flatten:t=!1}=f,s=e.split(/\r?\n/),a=[],i=[],n=[],m={title:"",jcamp:"",children:[]},r=0,p=e.includes("## ");for(let c=0;c<s.length;c++){let b=s[c],h=p?b.replaceAll(" ",""):b;if(h.startsWith("##NTUPLES")&&r++,h.startsWith("##TITLE")){let o=[h.slice(8).trim()];for(let l=c+1;l<s.length&&!s[l].startsWith("##");l++)o.push(s[l].trim());i.push({title:o.join(`
|
|
2
|
-
`),jcamp:`${b}
|
|
3
|
-
`,children:[]}),m=i.at(-1),a.push(m)}else if(h.startsWith("##END")&&r===0&&m){m.jcamp+=`${b}
|
|
4
|
-
`;let o=i.pop();if(!o)throw new Error("Not finished");i.length>0?(m=i.at(-1),m.children?.push(o)):(m=void 0,n.push(o))}else if(m?.jcamp){m.jcamp+=`${b}
|
|
5
|
-
`;let o=h.match(/^##(.*?)=(.+)/);if(o){let l=o[1].replaceAll(/[ _-]/g,"").toUpperCase();l==="DATATYPE"?m.dataType=o[2].trim():l==="DATACLASS"?m.dataClass=o[2].trim():l==="JCAMPDX"?m.jcampDX=M(o[2].trim()):l==="JCAMPCS"&&(m.jcampCS=M(o[2].trim()))}}h.startsWith("##END")&&r>0&&r--}if(t){for(let c of a)c.children=void 0;return a}else return n}var ce=require("dynamic-typing"),ue=require("ensure-string");var ie=["TIC",".RIC","SCANNUMBER"];function ae(e){let f=e.spectra,t=f.length,s={times:new Array(t),series:{ms:{dimension:2,data:new Array(t)}}},a=[];for(let i of ie){let n=V(i);f[0][n]&&(a.push(n),s.series[n]={dimension:1,data:new Array(t)})}for(let i=0;i<t;i++){let n=f[i];s.times[i]=n.pageValue;for(let m of a)s.series[m].data[i]=Number(n[m]);n.data&&(s.series.ms.data[i]=[n.data.x,n.data.y])}e.chromatogram=s}function le(e){return ie.includes(e)}function V(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"")}function E(e){return e.map(Number)}function B(e,f,t){let{logger:s}=t;s&&(e.xFactor||s.info("The xFactor is not defined, it will be set to 1"),e.yFactor||s.info("The yFactor is not defined, it will be set to 1"));let a=e.yFactor??1,i=e.xFactor??1,n=e.deltaX??1,m=Math.abs(n*.1),r=.01;e.isXYdata=!0;let p={x:[],y:[]};e.data=p;let c=e.firstX||0,b=e.firstY||0,h=!1,o,l=0;for(;l<f.length;l++)if(o=f.codePointAt(l),o===13||o===10)h=!0;else if(h)break;let u=0,d=!0,C=!1,x=!1,U=0,N=!1,S=!1,g=0,X=0,O=!1,A=!1,Y=!1,R=0;for(;l<=f.length;l++)if(l===f.length?o=13:o=f.codePointAt(l),S)(o===13||o===10)&&(d=!0,S=!1,u++);else if(o<=57&&o>=48)A=!0,R>0?g+=(o-48)/10**R++:(g*=10,g+=o-48);else if(o===44||o===46)A=!0,R++;else{if(A){if(O&&(g=g*-1,O=!1),d)g*=i,s&&(x?Math.abs(c-n-g)>m&&(Math.abs(c-g)<m?s.trace(`Data line ${u}: After a DIFFERENCE the next line should repeat the last value and this does not seem to be the case: Current value: ${g} - Expected: ${c}.`):Math.abs(c-n-g)>10*m?s.trace(`Data line ${u}: The difference between the first value ${g} and the expected first x value ${c} based on increment after a DIFFERENCE is too high`):s.trace(`Data line ${u}: The difference between the first value ${g} and the expected first x value ${c} based on increment after a DIFFERENCE is too high`)):Math.abs(c-g)>m&&s.trace(`Data line ${u}: The difference between the first value ${g} and the first x value ${c} is too high`)),d=!1,x&&(Y=!0);else if(Y)Y=!1,s&&Math.abs(b-g)>r&&s.trace(`Data line ${u}: After a duplicate the next line should repeat the same value ${g} !== ${b}`),b=g;else{C?(U=O?0-g:g,x=!0,C=!1):N||(X=O?0-g:g);let y=N?g-1:1;for(let F=0;F<y;F++)x?b+=U:b=X,p.x.push(c),p.y.push(b*a),c+=n}O=!1,g=0,R=0,A=!1,N=!1}if(o<74&&o>63)A=!0,x=!1,g=o-64;else if(o>96&&o<106)A=!0,x=!1,g=o-96,O=!0;else if(o===115)A=!0,N=!0,g=9;else if(o>82&&o<91)A=!0,N=!0,g=o-82;else if(o>73&&o<83)A=!0,C=!0,g=o-73;else if(o>105&&o<115)A=!0,C=!0,g=o-105,O=!0;else if(o===36&&f.codePointAt(l+1)===36)A=!0,S=!0;else if(o===37)A=!0,C=!0,g=0,O=!1;else if(o===45){let y=f.codePointAt(l+1);(y!==void 0&&y>=48&&y<=57||y===44||y===46)&&(A=!0,d||(x=!1),O=!0)}else(o===13||o===10)&&(d=!0,S=!1,u++)}s&&x&&s.warn("The last value is a difference, it should be repeated on the next line")}var fe=/[,\t ]+/;function w(e,f,t){if(e.isPeaktable=!0,!e.variables||Object.keys(e.variables).length===2?Se(e,f,t):ve(e,f,t),e.variables)for(let s in e.variables)e.variables[s].data=e.data?.[s]}function Se(e,f,t){let{logger:s}=t,a={x:[],y:[]};e.data=a;let i=f.split(/,? *,?[;\r\n]+ */);for(let n=1;n<i.length;n++){let m=i[n].trim().replace(P,"").split(fe);if(m.length%2===0)for(let r=0;r<m.length;r=r+2)e.xFactor!==void 0&&e.yFactor!==void 0&&(a.x.push(Number(m[r])*e.xFactor),a.y.push(Number(m[r+1])*e.yFactor));else s?.warn(`Format error: ${m.toString()}`)}}function ve(e,f,t){let{logger:s}=t,a={},i=Object.keys(e.variables),n=i.length;for(let r of i)a[r]=[];e.data=a;let m=f.split(/,? *,?[;\r\n]+ */);for(let r=1;r<m.length;r++){let p=m[r].trim().replace(P,"").split(fe);if(p.length%n===0)for(let c=0;c<p.length;c++)a[i[c%n]].push(Number(p[c]));else s?.warn(`Wrong number of columns: ${p.toString()}`)}}function Z(e,f){e.isXYAdata=!0;let t={};e.data=t;let s=f.split(/\r?\n/),a=s[0].replace(/^.*?([A-Z]+).*$/,"$1").split("").map(i=>i.toLowerCase());for(let i=1;i<s.length;i++){let n=s[i].replace(/^\((.*)\)$/,"$1").split(/ *, */);for(let m=0;m<a.length;m++){let r=n[m];switch(a[m]){case"x":case"y":case"w":r=Number.parseFloat(r);break;case"a":r=r.replace(/^<(.*)>$/,"$1");break;case"m":break;default:continue}t[a[m]]||(t[a[m]]=[]),t[a[m]].push(r)}}}var Q=require("dynamic-typing");var G=require("gyromagnetic-ratio"),W=Ce(require("ml-array-median"),1);function me(e){return Array.isArray(e)?e[0]:e}function H(e){let{spectra:f}=e,t=f[0].data.y[0],s=t,a=f.length,i=f[0].data.x.length||0,n=new Array(a);for(let o=0;o<a;o++){n[o]=f[o].data.y;for(let l=0;l<i;l++){let u=n[o][l];u<t&&(t=u),u>s&&(s=u)}}let m=f[0].data.x[0],r=f[0].data.x.at(-1),{firstY:p,lastY:c}=Te(e);if(m>r)for(let o of n)o.reverse();p>c&&n.reverse();let b=[];for(let o of n){let l=Float64Array.from(o);for(let u=0;u<l.length;u++)l[u]<0&&(l[u]=-l[u]);b.push((0,W.default)(l))}let h=(0,W.default)(b);return{z:n,minX:Math.min(m,r),maxX:Math.max(m,r),minY:Math.min(p,c),maxY:Math.max(p,c),minZ:t,maxZ:s,noise:h}}function Te(e){let{spectra:f,ntuples:t,info:s}=e;if(t)for(let a of t){let{symbol:i,nucleus:n,units:m}=a;if(i.match(/[F|T]1/)&&m?.toUpperCase().match("HZ")){let r=me(s[".OBSERVEFREQUENCY"]),{nucleus:p}=t.find(u=>u.symbol.match(/[F|T]2/));if([r,p,n].some(u=>!u))break;let c=(0,G.getGyromagneticRatio)(p),b=(0,G.getGyromagneticRatio)(n),{first:h,last:o}=a,l=b!==null&&c!==null?r*b/c:r;return{firstY:h/l,lastY:o/l}}}return{firstY:f[0].pageValue,lastY:f.at(-1).pageValue}}function J(e,f){let t=e.noise,s=e.z,a,i,n,m,r,p,c,b,h=s.length,o=s[0].length,l,u,d,C,x=e.minX,N=(e.maxX-x)/(o-1),S=e.minY,X=(e.maxY-S)/(h-1),O=e.minZ,A=e.maxZ,Y=f.nbContourLevels*2,R=new Array(Y),y;for(let F=0;F<Y;F++){let k={};R[F]=k;let pe=F%2,te=(A-f.noiseMultiplier*t)*Math.exp((F>>1)-f.nbContourLevels);pe===0?y=te+f.noiseMultiplier*t:y=0-te-f.noiseMultiplier*t;let D=[];if(k.zValue=y,k.lines=D,!(y<=O||y>=A))for(let T=0;T<h-1;T++){let ne=s[T],re=s[T+1];for(let v=0;v<o-1;v++)a=ne[v],i=ne[v+1],n=re[v],m=re[v+1],r=a>y,p=i>y,c=n>y,b=m>y,r!==p&&r!==c&&(l=v+(y-a)/(i-a),u=T,d=v,C=T+(y-a)/(n-a),D.push(l*N+x,u*X+S,d*N+x,C*X+S)),b!==p&&b!==c&&(l=v+1,u=T+1-(y-m)/(i-m),d=v+1-(y-m)/(n-m),C=T+1,D.push(l*N+x,u*X+S,d*N+x,C*X+S)),p!==c&&(l=(v+1-(y-i)/(n-i))*N+x,u=(T+(y-i)/(n-i))*X+S,p!==r&&(d=v+1-(y-i)/(a-i),C=T,D.push(l,u,d*N+x,C*X+S)),c!==r&&(d=v,C=T+1-(y-n)/(a-n),D.push(l,u,d*N+x,C*X+S)),p!==b&&(d=v+1,C=T+(y-i)/(m-i),D.push(l,u,d*N+x,C*X+S)),c!==b&&(d=v+(y-n)/(m-n),C=T+1,D.push(l,u,d*N+x,C*X+S)))}}return{minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.maxY,segments:R}}function q(e,f){let t=H(e);f.noContour||(e.contourLines=J(t,f),delete t.z),e.minMax=t}var j=require("gyromagnetic-ratio");function z(e,f){for(let t of e){let s=0,a=0;for(let i of t.spectra){if(t.ntuples?.symbol?(!s&&i.observeFrequency&&(s=i.observeFrequency),!a&&i.shiftOffsetVal&&(a=i.shiftOffsetVal)):(s=i.observeFrequency,a=i.shiftOffsetVal),s&&i.xUnits?.toUpperCase().includes("HZ")&&(i.xUnits="PPM",i.xFactor=i.xFactor!==void 0?i.xFactor/s:void 0,i.firstX=i.firstX!==void 0?i.firstX/s:void 0,i.lastX=i.lastX!==void 0?i.lastX/s:void 0,i.deltaX=i.deltaX!==void 0?i.deltaX/s:void 0,i.data))for(let n=0;n<i.data.x.length;n++)i.data.x[n]/=s;if(a&&i.xUnits.toLowerCase().includes("ppm")&&i.firstX!==void 0&&i.lastX!==void 0){let n=i.firstX-a;if(i.firstX=i.firstX-n,i.lastX=i.lastX-n,i.data)for(let m=0;m<i.data.x.length;m++)i.data.x[m]-=n}if(t.ntuples?.nucleus&&t.ntuples.symbol)for(let n=0;n<t.ntuples.nucleus.length;n++){let m=t.ntuples.symbol[n],r=t.ntuples.nucleus[n];if(m.match(/^[F|T]/)&&!r){if(m.match(/[F|T]1/))if(t.tmp.$NUC2&&typeof t.tmp.$NUC2=="string")t.ntuples.nucleus[n]=t.tmp.$NUC2;else{let p=t.ntuples.symbol.indexOf(m.replace(/^([F|T]).*/,"$12"));p&&t.ntuples.nucleus[p]&&(t.ntuples.nucleus[n]=t.ntuples.nucleus[p])}m.match(/[F|T]2/)&&typeof t.tmp.$NUC1=="string"&&(t.ntuples.nucleus[n]=t.tmp.$NUC1)}m.match(/[F|T]2/)&&(t.yType=t.ntuples.nucleus[0],t.xType&&!(0,j.getGyromagneticRatio)(t.xType)&&(t.xType=t.ntuples.nucleus[1]))}if(s&&t.ntuples?.symbol&&t.ntuples.nucleus){let n="",m=t.ntuples.symbol.indexOf(i.pageSymbol);t.ntuples.units?.[m]&&(n=t.ntuples.units[m]);let{nucleus:r}=t.ntuples;if(!n.toLowerCase().match(/(ppm|seconds)/)&&r.length>1){if(m!==0){let h="Not sure about this ntuples format";if(f){f.warn(h);continue}else throw new Error(h)}let{nucleus:p}=t.ntuples,c=(0,j.getGyromagneticRatio)(p[0]),b=(0,j.getGyromagneticRatio)(p[1]);if(!c||!b){let h=`Problem with determination of gyromagnetic ratio for ${p.join("-")}`;if(f)f.error(h);else throw new Error(h)}else{let h=c/b*s;i.pageValue/=h}}}}}}function K(e){let f=e.spectra[0].data;e.chromatogram={times:f.x.slice(),series:{intensity:{dimension:1,data:f.y.slice()}}}}function _(e,f,t){z(e,t.logger),Xe(e,t);for(let s of e){if(Object.keys(s.ntuples).length>0){let a=[],i=Object.keys(s.ntuples);for(let n of i){let m=s.ntuples[n];if(m)for(let r=0;r<m.length;r++)a[r]||(a[r]={}),a[r][n]=m[r]}s.ntuples=a}s.twoD&&t.wantXY&&(q(s,t),t.logger?.trace({profiling:!0},"Finished countour plot calculation"),t.keepSpectra||delete s.spectra),t.chromatogram&&(s.spectra.length>1?ae(s):K(s),t.logger?.trace({profiling:!0},"Finished chromatogram calculation")),delete s.tmp}}function Xe(e,f){for(let t of e)for(let s in t.meta){let a=t.meta[s];if(typeof a=="string"){if(a.startsWith("{")){if(!a.includes(":")&&a.endsWith("}")){let i=a.slice(1,-1).split(/[,; ]+/).filter(Boolean);for(let n=0;n<i.length;n++)t.meta[s+String(n)]=f.dynamicTyping?(0,Q.parseString)(i[n]):i[n]}}else if(a.startsWith("(")){let i=a.split(/\r?\n/),n=/^\((?<from>\d+)\.\.(?<to>\d+)\).*$/;if(n.test(i[0])){let[m,r]=i[0].match(n)?.slice(1).map(Number)??[],p=i.slice(1).join(" ").split(/[,; ]+/).filter(Boolean);for(let c=m;c<=r;c++)f.dynamicTyping&&typeof p[c-m]=="string"?t.meta[s+String(c)]=(0,Q.parseString)(p[c-m]):t.meta[s+String(c)]=p[c-m]}}}}}function ee(e,f,t){let s=-1,a=-1,i="",n="";if(t.indexOf("++")>0)i=t.replace(/.*\(([a-zA-Z0-9]+)\+\+.*/,"$1"),n=t.replace(/.*\.\.([a-zA-Z0-9]+).*/,"$1");else{t=t.replaceAll(/[^a-zA-Z%]/g,""),i=t.charAt(0),n=t.charAt(1),f.variables={};for(let m of t){let r=m.toLowerCase(),p=e.ntuples.symbol?.indexOf(m)||0;if(p===-1)throw new Error(`Symbol undefined: ${m}`);f.variables[r]={};for(let c in e.ntuples)e.ntuples[c]?.[p]&&(f.variables[r][c.replace(/^var/,"")]=e.ntuples[c]?.[p])}}s=e.ntuples.symbol?.indexOf(i)??-1,a=e.ntuples.symbol?.indexOf(n)??-1,s===-1&&(s=0),a===-1&&(a=0),e.ntuples.first&&(e.ntuples.first.length>s&&(f.firstX=e.ntuples.first[s]),e.ntuples.first.length>a&&(f.firstY=e.ntuples.first[a])),e.ntuples.last&&(e.ntuples.last.length>s&&(f.lastX=e.ntuples.last[s]),e.ntuples.last.length>a&&(f.lastY=e.ntuples.last[a])),e.ntuples.vardim&&e.ntuples.vardim.length>s&&(f.nbPoints=e.ntuples.vardim[s]),e.ntuples.factor&&(e.ntuples.factor.length>s&&(f.xFactor=e.ntuples.factor[s]),e.ntuples.factor.length>a&&(f.yFactor=e.ntuples.factor[a])),e.ntuples.units&&(e.ntuples.units.length>s&&(e.ntuples.varname?.[s]?f.xUnits=`${e.ntuples.varname[s]} [${e.ntuples.units[s]}]`:f.xUnits=e.ntuples.units[s]),e.ntuples.units.length>a&&(e.ntuples.varname?.[a]?f.yUnits=`${e.ntuples.varname[a]} [${e.ntuples.units[a]}]`:f.yUnits=e.ntuples.units[a]))}function I(e){e.xFactor||(e.xFactor=1),e.yFactor||(e.yFactor=1)}var L=/[ \t]*,[ \t]*/,Le={removeComments:!1,keepRecordsRegExp:/^$/,canonicDataLabels:!0,canonicMetadataLabels:!1,dynamicTyping:!0,withoutXY:!1,noTrimRegExp:/^$/,chromatogram:!1,keepSpectra:!1,noContour:!1,nbContourLevels:7,noiseMultiplier:5};function Oe(e,f={}){e=(0,ue.ensureString)(e);let t={...Le,...f};t.logger?.debug("Starting jcamp conversion"),t.wantXY=!t.withoutXY,t.start=Date.now();let s=[],a={entries:[],flatten:[]},i={children:[],spectra:[],ntuples:{},info:{},meta:{},tmp:{}},n=i,m=[],r={data:{}};t.logger?.trace({profiling:!0},"Before split to LDRS");let p=e.replaceAll(/[\r\n]+##/g,`
|
|
6
|
-
##`).split(`
|
|
7
|
-
##`);t.logger?.trace({profiling:!0},"Split to LDRS"),p[0]&&(p[0]=p[0].replace(/^[\r\n ]*##/,""));for(let c of p){let b=c.indexOf("="),h=b>0?c.slice(0,Math.max(0,b)):c,o=b>0?h.match(t.noTrimRegExp)?c.slice(Math.max(0,b+1)):c.slice(Math.max(0,b+1)).trim():"",l=h.replaceAll(/[_ -]/g,"").toUpperCase();if(l==="DATATABLE"){let u=o.indexOf(`
|
|
8
|
-
`);if(u===-1&&(u=o.indexOf("\r")),u>0){let d=o.slice(0,Math.max(0,u)).split(/[ ,;\t]+/);ee(n,r,d[0]),r.datatable=d[0],d[1]?.includes("PEAKS")?l="PEAKTABLE":d[1]&&(d[1].indexOf("XYDATA")||d[0].indexOf("++")>0)&&(l="XYDATA",r.nbPoints&&r.lastX!==void 0&&r.firstX!==void 0&&(r.deltaX=(r.lastX-r.firstX)/(r.nbPoints-1)))}}if(l==="XYDATA"){t.wantXY&&(I(r),o.match(/.*\+\+.*/)?(r.nbPoints&&r.lastX!==void 0&&r.firstX!==void 0&&(r.deltaX=(r.lastX-r.firstX)/(r.nbPoints-1)),B(r,o,t)):w(r,o,t),n?.spectra.push(r),r={data:{}});continue}else if(l==="PEAKTABLE"){t.wantXY&&(I(r),w(r,o,t),n?.spectra.push(r),r={data:{}});continue}if(l==="PEAKASSIGNMENTS"){t.wantXY&&(o.match(/.*[^A-Z]*.*/)&&Z(r,o),n?.spectra.push(r),r={data:{}});continue}if(t.removeComments&&(o=o.split(/\r?\n/).map(u=>u.replace(/ *\$\$.*$/,"")).join(`
|
|
9
|
-
`)),l==="TITLE"){let u=n;u.children||(u.children=[]),n={spectra:[],ntuples:{},info:{},meta:{},tmp:{}},u.children.push(n),m.push(u),s.push(n),n.title=o}else l==="DATATYPE"?(n.dataType=o,o.match(/^nd|\snd\s/i)&&(n.twoD=!0)):l==="NTUPLES"?o.match(/^nd|\snd\s/i)&&(n.twoD=!0):l==="DATACLASS"?n.dataClass=o:l==="JCAMPDX"?n.jcampDX=M(o):l==="JCAMPCS"?n.jcampCS=M(o):l==="XUNITS"?r.xUnits=o:l==="YUNITS"?r.yUnits=o:l==="FIRSTX"?r.firstX=Number(o):l==="LASTX"?r.lastX=Number(o):l==="FIRSTY"?r.firstY=Number(o):l==="LASTY"?r.lastY=Number(o):l==="NPOINTS"?r.nbPoints=Number(o):l==="XFACTOR"?r.xFactor=Number(o):l==="YFACTOR"?r.yFactor=Number(o):l==="MAXX"?r.maxX=Number(o):l==="MINX"?r.minX=Number(o):l==="MAXY"?r.maxY=Number(o):l==="MINY"?r.minY=Number(o):l==="DELTAX"?r.deltaX=Number(o):l===".OBSERVEFREQUENCY"||l==="$SFO1"?r.observeFrequency||(r.observeFrequency=Number(o)):l===".OBSERVENUCLEUS"?r.xType||(n.xType=o.replaceAll(/[^a-zA-Z0-9]/g,"")):l==="$OFFSET"?(n.shiftOffsetNum=0,r.shiftOffsetVal||(r.shiftOffsetVal=Number(o))):l==="$REFERENCEPOINT"||(l==="VARNAME"?n.ntuples.varname=o.split(L):l==="SYMBOL"?n.ntuples.symbol=o.split(L):l==="VARTYPE"?n.ntuples.vartype=o.split(L):l==="VARFORM"?n.ntuples.varform=o.split(L):l==="VARDIM"?n.ntuples.vardim=E(o.split(L)):l==="UNITS"?n.ntuples.units=o.split(L):l==="FACTOR"?n.ntuples.factor=E(o.split(L)):l==="FIRST"?n.ntuples.first=E(o.split(L)):l==="LAST"?n.ntuples.last=E(o.split(L)):l==="MIN"?n.ntuples.min=E(o.split(L)):l==="MAX"?n.ntuples.max=E(o.split(L)):l===".NUCLEUS"?n.ntuples&&(n.ntuples.nucleus=o.split(L).map(u=>u.replaceAll(/[^a-zA-Z0-9]/g,""))):l==="PAGE"?(r.page=o.trim(),r.pageValue=Number(o.replace(/^.*=/,"")),r.pageSymbol=r.page.replace(/[=].*/,"")):l==="RETENTIONTIME"?r.pageValue=Number(o):le(l)?r[V(l)]=o:l==="SAMPLEDESCRIPTION"?r.sampleDescription=o:l.startsWith("$NUC")?!n.tmp[l]&&!o.includes("off")&&(n.tmp[l]=o.replaceAll(/[<>]/g,"")):l==="END"&&(n=m.pop()));if(n?.info&&n.meta&&l.match(t.keepRecordsRegExp)){let u,d;h.startsWith("$")?(d=t.canonicMetadataLabels?l.slice(1):h.slice(1),u=n.meta):(d=t.canonicDataLabels?l:h,u=n.info),t.dynamicTyping&&(o=(0,ce.parseString)(o)),u[d]?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(o)):u[d]=o}}if(t.logger?.trace({profiling:!0},"Finished parsing"),_(s,a,t),t.logger?.trace({profiling:!0},"Total time"),a.entries=i.children||[],a.flatten=s,t.logger){t.logger.debug("Finished jcamp conversion");for(let c of a.flatten)t.logger.debug(`${c.dataType} - ${c.title}`)}return a}function Me(e,f){let{logger:t,OCL:s}=f;if(!e.info.ATOMLIST||!e.info.BONDLIST){t?.warn("No ATOMLIST or BONDLIST in the JCAMP-CS entry");return}Ye(e,t);let a=Ee(e.info.ATOMLIST),i=Re(e.info.BONDLIST),n=De(e.info.CHARGE,t),m=Fe(s,a,i,n,t);return{molecule:m,molfile:m.toMolfile()}}function Fe(e,f,t,s,a){let i={S:e.Molecule.cBondTypeSingle,D:e.Molecule.cBondTypeDouble,T:e.Molecule.cBondTypeTriple,Q:e.Molecule.cBondTypeQuadruple},n={},m=new e.Molecule(f.length,t.length);for(let r of f){let p=e.Molecule.getAtomicNoFromLabel(r.element);p||(a?.error(`Atomic number of ${r.element} could not be determined`),p=e.Molecule.getAtomicNoFromLabel("X")),n[r.atomNumber]=m.addAtom(p),m.setAtomMapNo(n[r.atomNumber],r.atomNumber,!1)}for(let r of t){if(n[r.atomNumber1]===void 0){a?.error(`A bond goes to atomNumber ${r.atomNumber1} that does not exists`);continue}if(n[r.atomNumber2]===void 0){a?.error(`A bond goes to atomNumber ${r.atomNumber2} that does not exists`);continue}let p=m.addBond(n[r.atomNumber1],n[r.atomNumber2]);m.setBondType(p,i[r.bondType])}for(let r of s){if(n[r.atomNumber]===void 0){a?.error(`A charge goes to atomNumber ${r.atomNumber} that does not exists`);continue}m.setAtomCharge(n[r.atomNumber],r.value)}return m}function Ee(e){let f=e.split(/\r?\n/).map(s=>M(s)).filter(Boolean),t=[];for(let s of f){let[a,i,n]=s.trim().split(/\s+/);t.push({atomNumber:Number(a),element:i,nbImplicitHydrogens:n?.length>0?Number(n):void 0})}return t}function Re(e){let f=e.split(/\r?\n/).map(s=>M(s)).filter(Boolean),t=[];for(let s of f){let[a,i,n]=s.trim().split(/\s+/);t.push({atomNumber1:Number(a),atomNumber2:Number(i),bondType:n})}return t}function De(e,f){if(!e)return[];let t=e.split(/\r?\n/).map(a=>M(a)).filter(Boolean),s=[];for(let a of t){let[i,n,m]=a.trim().split(/\s+/);m!==void 0&&f?.warn("Charge on multiple atom is not supported"),s.push({atomNumber:Number(n),value:Number(i)})}return s}function Ye(e,f){let t=["STEREOPAIR","STEREOCENTER","RADICAL","STEREOMOLECULE"];for(let s of t)e.info[s]&&f?.warn(`JCAMP-CS parser do not support: ${s}`)}
|
|
File without changes
|