Comparing version 1.0.3 to 1.0.4
@@ -7,2 +7,3 @@ export declare const timerCalc: { | ||
calcEnergy: (energy: number, time: number) => number; | ||
countDownNextQuarter: (time: number) => string; | ||
}; |
@@ -27,2 +27,19 @@ "use strict"; | ||
}; | ||
var getNextQuarterTime = function (time) { | ||
if (time === void 0) { time = currentTime(); } | ||
return getLastFullQuarter(time) + 15 * 60; | ||
}; | ||
var calculateTimeToNextQuarter = function (time) { | ||
var nextQuarter = getNextQuarterTime(time); | ||
var timeLeft = nextQuarter - currentTime(); | ||
return timeLeft; | ||
}; | ||
var countDownNextQuarter = function (time) { | ||
var timeLeft = calculateTimeToNextQuarter(time); | ||
var minutes = Math.floor(timeLeft / 60); | ||
var seconds = timeLeft % 60; | ||
var showM = minutes < 10 ? "0".concat(minutes) : minutes; | ||
var showS = seconds < 10 ? "0".concat(seconds) : seconds; | ||
return "".concat(showM, ":").concat(showS); | ||
}; | ||
exports.timerCalc = { | ||
@@ -34,2 +51,3 @@ currentTime: currentTime, | ||
calcEnergy: calcEnergy, | ||
countDownNextQuarter: countDownNextQuarter, | ||
}; |
{ | ||
"name": "@xxskyy/zh", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -20,3 +20,2 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@types/sinon": "^10.0.11", | ||
"@types/chai": "^4.3.0", | ||
@@ -26,7 +25,8 @@ "@types/mocha": "^9.1.0", | ||
"@types/redis": "^4.0.11", | ||
"@types/sinon": "^10.0.11", | ||
"chai": "^4.3.6", | ||
"mocha": "^9.2.2", | ||
"nyc": "^15.1.0", | ||
"sinon": "^13.0.1", | ||
"ts-node": "^10.7.0", | ||
"sinon": "^13.0.1", | ||
"typescript": "^4.6.2" | ||
@@ -33,0 +33,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13160
239