tinify-client
Version:
A CLI to compress your images not only intelligently but also to the EXTREME!
14 lines (13 loc) • 419 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.timeToReadable = exports.isString = exports.last = void 0;
exports.last = (arr) => {
return arr[arr.length - 1];
};
exports.isString = (obj) => {
return typeof obj === 'string';
};
exports.timeToReadable = (ms) => {
const seconds = String(ms / 1000);
return seconds.includes('.') ? `${seconds}s` : `${seconds}.0s`;
};