-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
beac31f
commit 259a34a
Showing
19 changed files
with
157 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
|
||
/** | ||
* Typically used when html classes are conditionally rendered | ||
* @returns a string array of all the html classes that will be added to an element. | ||
*/ | ||
export function cn(...classes: String[]) { | ||
return classes.filter(Boolean).join(" "); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
|
||
/** | ||
* @returns a string that is only an event string from the log file | ||
*/ | ||
export function extractEventFromLine(line: string, timestamp: string): string { | ||
line = line.replace(timestamp, "") | ||
line = line.replace(/(^\s*)|(\s*$)/gi,""); //remove leading and trailing spaces | ||
line = line.replace(/\n /,"\n"); //remove newlines | ||
//remove leading and trailing spaces | ||
line = line.replace(/(^\s*)|(\s*$)/gi,""); | ||
//remove newlines | ||
line = line.replace(/\n /,"\n"); | ||
line = line.replace(/\r/, ""); | ||
return line; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
|
||
/** | ||
* @returns A promise Promise<string[]>. That is a promise that when resolved contains all the lines from a logfile. | ||
*/ | ||
export async function getFileLines(file: File): Promise<string[]> { | ||
return new Promise<string[]>((resolve, reject) => { //must return promise because reader is async | ||
//must return promise because reader is async | ||
return new Promise<string[]>((resolve, reject) => { | ||
let reader = new FileReader(); | ||
reader.onload = async (event) => { | ||
let textLines = (reader.result as string).split("\n"); //split file on newlines | ||
//split file on newlines | ||
let textLines = (reader.result as string).split("\n"); | ||
textLines = textLines.filter(line => line.replace(/(\r\n|\n|\r)/gm, "") !== '') | ||
resolve(textLines); //all went well, return textLines | ||
//all went well, return textLines | ||
resolve(textLines); | ||
}; | ||
reader.onerror = async (e) => { //on error reject | ||
//on error reject | ||
reader.onerror = async (e) => { | ||
console.error("Unable to read file", file.name, e); | ||
reject(e); | ||
}; | ||
reader.readAsText(file); //call reader | ||
//call reader | ||
reader.readAsText(file); | ||
}); | ||
} |
Oops, something went wrong.