@a-type/utils
Advanced tools
Comparing version 1.0.7 to 1.0.8
export declare function capitalize(str: string): string; | ||
export declare function shortenTimeUnits(time: string): string; | ||
export declare function formatMinutes(minutes: number): string; | ||
export declare function fractionToText(decimal: number): string; | ||
export declare function isUrl(str: string): boolean; | ||
export declare function urlify(str: string): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.urlify = exports.isUrl = exports.fractionToText = exports.shortenTimeUnits = exports.capitalize = void 0; | ||
exports.urlify = exports.isUrl = exports.fractionToText = exports.formatMinutes = exports.shortenTimeUnits = exports.capitalize = void 0; | ||
function capitalize(str) { | ||
@@ -17,2 +17,8 @@ return str.charAt(0).toUpperCase() + str.slice(1); | ||
exports.shortenTimeUnits = shortenTimeUnits; | ||
function formatMinutes(minutes) { | ||
const hours = Math.floor(minutes / 60); | ||
const min = minutes % 60; | ||
return `${hours ? `${hours} hr` : ''}${min ? ` ${min} min` : ''}`; | ||
} | ||
exports.formatMinutes = formatMinutes; | ||
function fractionToText(decimal) { | ||
@@ -19,0 +25,0 @@ let maxDenominator = 10; |
export declare function capitalize(str: string): string; | ||
export declare function shortenTimeUnits(time: string): string; | ||
export declare function formatMinutes(minutes: number): string; | ||
export declare function fractionToText(decimal: number): string; | ||
export declare function isUrl(str: string): boolean; | ||
export declare function urlify(str: string): string; |
@@ -12,2 +12,7 @@ export function capitalize(str) { | ||
} | ||
export function formatMinutes(minutes) { | ||
const hours = Math.floor(minutes / 60); | ||
const min = minutes % 60; | ||
return `${hours ? `${hours} hr` : ''}${min ? ` ${min} min` : ''}`; | ||
} | ||
export function fractionToText(decimal) { | ||
@@ -14,0 +19,0 @@ let maxDenominator = 10; |
{ | ||
"name": "@a-type/utils", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "access": "public", |
@@ -14,2 +14,8 @@ export function capitalize(str: string) { | ||
export function formatMinutes(minutes: number) { | ||
const hours = Math.floor(minutes / 60); | ||
const min = minutes % 60; | ||
return `${hours ? `${hours} hr` : ''}${min ? ` ${min} min` : ''}`; | ||
} | ||
export function fractionToText(decimal: number) { | ||
@@ -16,0 +22,0 @@ let maxDenominator = 10; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30362
571