From 9463e197e3ca82135b14d0c566353b8d0c34ccba Mon Sep 17 00:00:00 2001 From: Utkarsh Verma Date: Fri, 6 May 2022 07:55:30 +0530 Subject: [PATCH] Update index.js --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 0ff7f41..63956aa 100644 --- a/index.js +++ b/index.js @@ -64,15 +64,15 @@ module.exports = async options => { if (!isTimestamp(options.endTime)) { options.endTime = video.duration } + // Float values + options.startTime = +options.startTime + options.endTime = +options.endTime + if (options.startTime >= options.endTime) { options.startTime = options.endTime options.count = 1 } - // Float values - options.startTime = +options.startTime - options.endTime = +options.endTime - // Convert count value to a positive integer (floor() or 0 if string) options.count = Math.abs(~~options.count) if (options.count === 0) { options.count = 1 }