From 2611f42623f1cce749c25ecefdf5e4d9e5dda0f4 Mon Sep 17 00:00:00 2001 From: David Vegh Date: Sat, 30 Apr 2022 13:46:26 +0200 Subject: [PATCH] statdate.js: fix start/end date assertation fix #47 --- src/statdate.js | 6 +++--- src/writenpmstat.js | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/statdate.js b/src/statdate.js index 843fb13..6d8827a 100644 --- a/src/statdate.js +++ b/src/statdate.js @@ -5,7 +5,7 @@ class StatDate { constructor(start, end) { this.#start = StatDate.formatStart(start); this.#end = StatDate.formatEnd(end); - if (this.#start >= this.#end) { + if (this.#start > this.#end) { throw new Error("start must be before end"); } } @@ -17,7 +17,7 @@ class StatDate { set start(start) { start = StatDate.formatStart(start); if (this.end && start) { - if (start <= this.end) { + if (start > this.end) { throw new Error("start must be before end"); } } @@ -31,7 +31,7 @@ class StatDate { set end(end) { end = StatDate.formatEnd(end); if (this.start && end) { - if (this.start <= end) { + if (this.start > end) { throw new Error("start must be before end"); } } diff --git a/src/writenpmstat.js b/src/writenpmstat.js index 0a440ed..56d297d 100644 --- a/src/writenpmstat.js +++ b/src/writenpmstat.js @@ -229,8 +229,6 @@ class WriteNpmStat { } Promise.all(csvFilesReady).then(() => { for (const [key] of Object.entries(stats)) { - console.log(csvFiles); - console.log(key); if (csvFiles[key]) { stats[key] = csvFiles[key].concat(stats[key]); }