From 9da3afa8df6cf0e0eb17122ceadeeb17ebd346ae Mon Sep 17 00:00:00 2001 From: tremblap Date: Sun, 13 Aug 2023 17:48:03 +0100 Subject: [PATCH] patching-resample-exception in samplers.js when the step is smaller than 1, the copying of the input[bucketStart] saves issues and is more straightforward. --- src/samplers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/samplers.js b/src/samplers.js index 9775940..3edbd08 100644 --- a/src/samplers.js +++ b/src/samplers.js @@ -13,7 +13,7 @@ module.exports = { if(bucketStart > this.data.length - 1 ) bucketStart = this.data.length -1; if(bucketEnd > this.data.length -1 ) bucketEnd = this.data.length -1; if(bucketStart === bucketEnd) { - if(i>0) newData[i] = newData[i-1]; + newData[I] = this.data[bucketStart]; } else newData[i] = stats[method](this.data.slice(bucketStart, bucketEnd)); }