WakaTime plugin (#90)

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

No files matched your search

+9
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--) {