diff --git a/package.json b/package.json index 2042c60..f31c190 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/utils", - "version": "0.26.17", + "version": "0.26.18", "description": "Utility library", "author": "Zak Timson", "license": "MIT", diff --git a/src/string.ts b/src/string.ts index 0179a50..825340b 100644 --- a/src/string.ts +++ b/src/string.ts @@ -45,11 +45,10 @@ export function formatBytes(bytes: number, decimals = 2) { /** * Convert milliseconds to human-readable duration - * @param {string} number milliseconds + * @param {string} ms milliseconds * @return {string} formated duration */ -export function formatMs(number: string): string { - const ms = parseInt(number, 10); +export function formatMs(ms: number): string { if (isNaN(ms) || ms < 0) return "Invalid input"; const seconds = ms / 1000; const minutes = seconds / 60;