UNPKG

podcast-rss

Version:

Podcast RSS feed generator. A really simple API to add Podcast-RSS feeds to any project. Forked from https://github.com/maxnowack/node-podcast

18 lines (17 loc) 554 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function pad(num) { const paddedString = `0${num}`; return paddedString.substring(paddedString.length - 2); } function toDurationString(seconds) { if (typeof seconds !== "number") { return seconds; } const hh = Math.floor(seconds / (60 * 60)); const remain = seconds % (60 * 60); const mm = Math.floor(remain / 60); const ss = Math.floor(remain % 60); return `${pad(hh)}:${pad(mm)}:${pad(ss)}`; } exports.default = toDurationString;