WakaTime plugin (#90)

This commit is contained in:
Simon Lecoq
2021-02-02 23:20:12 +01:00
committed by GitHub
parent eba6282309
commit da66a7bf8e
11 changed files with 328 additions and 3 deletions

View File

@@ -46,6 +46,15 @@
}
format.percentage = percentage
/** Text ellipsis formatter */
export function ellipsis(text, {length = 20} = {}) {
text = `${text}`
if (text.length < length)
return text
return `${text.substring(0, length)}`
}
format.ellipsis = ellipsis
/** Array shuffler */
export function shuffle(array) {
for (let i = array.length-1; i > 0; i--) {