@transloadit/format-duration-ms
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -1,1 +0,2 @@ | ||
export default function formatDurationMs(ms: number): string; | ||
declare const _default: (ms: number) => string; | ||
export = _default; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const pretty_ms_1 = __importDefault(require("pretty-ms")); | ||
function formatDurationMs(ms) { | ||
let human = (0, pretty_ms_1.default)(ms); | ||
const prettyMS = require("pretty-ms"); | ||
module.exports = function formatDurationMs(ms) { | ||
let human = prettyMS(ms); | ||
human = human.replace(/(\d+)\.\d+s/g, '$1s'); | ||
human = human.replace(/\s+/g, ''); | ||
return human; | ||
} | ||
exports.default = formatDurationMs; | ||
}; | ||
//# sourceMappingURL=formatDurationMs.js.map |
{ | ||
"name": "@transloadit/format-duration-ms", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"repository": { | ||
@@ -12,9 +12,7 @@ "type": "git", | ||
"types": "dist/formatDurationMs.d.ts", | ||
"directories": { | ||
"lib": "dist", | ||
"test": "dist" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1", | ||
"tsc": "tsc --build --clean && tsc --build" | ||
"build": "tsc --build --clean && tsc --build", | ||
"typecheck": "tsc --noEmit", | ||
"test": "tsx --test src/**/*.test.ts", | ||
"test:watch": "tsx --test --watch src/**/*.test.ts" | ||
}, | ||
@@ -26,4 +24,3 @@ "dependencies": { | ||
"access": "public" | ||
}, | ||
"gitHead": "412a97c914bd1a8c6d21df01c9f7e18ab19b218a" | ||
} | ||
} |
@@ -0,3 +1,3 @@ | ||
import assert from 'node:assert' | ||
import { describe, test } from 'node:test' | ||
import assert from 'node:assert' | ||
import formatDurationMs from './formatDurationMs' | ||
@@ -4,0 +4,0 @@ |
Sorry, the diff of this file is not supported yet
37118
11
40