begin converting WakatimeCore

This commit is contained in:
Vu Nguyen
2021-01-16 20:04:53 -06:00
parent d194bcfe60
commit 0c39fbbc79
25 changed files with 1205 additions and 55 deletions

View File

@@ -1,7 +1,7 @@
/**
* Returns domain from given URL.
*/
export function getDomainFromUrl(url: string): string {
export default function getDomainFromUrl(url: string): string {
const parts = url.split('/');
return parts[0] + '//' + parts[2];

View File

@@ -1,7 +1,7 @@
/**
* Returns boolean if needle is found in haystack or not.
*/
export function in_array<T>(needle: T, haystack: T[]): boolean {
export default function in_array<T>(needle: T, haystack: T[]): boolean {
for (let i = 0; i < haystack.length; i++) {
if (needle == haystack[i]) {
return true;