Skip to content

Commit 85d4718

Browse files
committed
update formatedEmissions
1 parent 2cd7aa3 commit 85d4718

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

dist/helpers/format.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ const formatedEmissions = function (peaks, maxY) {
278278
x: k,
279279
y: ordered[k]
280280
}));
281-
return ordered.map(o => `${o.x}`).join(', ');
281+
return `λex = ${fixedWavelength} nm; λem = ${ordered.map(o => `${o.x}`).join(', ')}`;
282282
};
283283
const formatedDLSIntensity = function (peaks, maxY) {
284284
let decimal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
@@ -422,12 +422,6 @@ const peaksWrapper = function (layout, shift) {
422422
};
423423
}
424424
const ops = spectraOps[layout];
425-
if (layout === _list_layout.LIST_LAYOUT.EMISSIONS) {
426-
return {
427-
head: `${ops.head}${solvTxt}: λex = ${fixedWavelength} nm; λem = `,
428-
tail: ops.tail
429-
};
430-
}
431425
return {
432426
head: `${ops.head}${solvTxt} = `,
433427
tail: ops.tail

src/__tests__/units/helpers/format.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('Test format helper', () => {
137137
it('Get peaks for Emission layout', () => {
138138
params.layout = LIST_LAYOUT.EMISSIONS
139139
const body = Format.peaksBody(params)
140-
expect(body).toEqual('2.0, 1.0')
140+
expect(body).toEqual('λex = nm; λem = 2.0, 1.0')
141141
})
142142

143143

src/helpers/format.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ const formatedEmissions = (
211211

212212
ordered = Object.keys(ordered).sort(sortFunc)
213213
.map((k) => ({ x: k, y: ordered[k] }));
214-
return ordered.map((o) => `${o.x}`).join(', ');
214+
return `λex = ${fixedWavelength} nm; λem = ${ordered.map((o) => `${o.x}`)
215+
.join(', ')}`;
215216
};
216217

217218
const formatedDLSIntensity = (
@@ -347,9 +348,6 @@ const peaksWrapper = (layout, shift, atIndex = 0) => {
347348
}
348349

349350
const ops = spectraOps[layout];
350-
if (layout === LIST_LAYOUT.EMISSIONS) {
351-
return { head: `${ops.head}${solvTxt}: λex = ${fixedWavelength} nm; λem = `, tail: ops.tail };
352-
}
353351
return { head: `${ops.head}${solvTxt} = `, tail: ops.tail };
354352
};
355353

0 commit comments

Comments
 (0)