WakaTime plugin (#90)
This commit is contained in:
1 parent
eba6282309
commit
da66a7bf8e
11 files changed
+328
-3
No files matched your search
@@ -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--) {
|
||||
|
||||
Reference in new issue
Block a user