From 53255dc9640126fe9c291fbbd2512d8f885617ab Mon Sep 17 00:00:00 2001 From: Luc Patiny Date: Tue, 13 Aug 2019 19:03:23 +0200 Subject: [PATCH] deal with array of empty exclusions --- src/Spectra.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Spectra.js b/src/Spectra.js index 5ed68fc..24166e6 100644 --- a/src/Spectra.js +++ b/src/Spectra.js @@ -14,7 +14,7 @@ export class Spectra { scaleSD: true, exclusions: [] } - : options.normalization; + : JSON.parse(JSON.stringify(options.normalization)); if (this.normalizationOptions.from > this.normalizationOptions.to) { [this.normalizationOptions.from, this.normalizationOptions.to] = [ this.normalizationOptions.to, @@ -23,7 +23,7 @@ export class Spectra { } if (Array.isArray(this.normalizationOptions.exclusions)) { this.normalizationOptions.exclusions = this.normalizationOptions.exclusions.filter( - (exclusion) => !exclusion.ignore + (exclusion) => exclusion && !exclusion.ignore ); } this.data = [];