This commit is contained in:
yoannchb-pro
2023-03-21 21:59:21 -04:00
committed by GitHub
parent 5289620caa
commit 5db3cfad63
18 changed files with 817 additions and 262 deletions
+21
View File
@@ -0,0 +1,21 @@
class Logs {
static question(text: string) {
const css = "color: cyan";
console.log("%c[QUESTION]: %s", css, text);
}
static responseTry(text: string, valide: boolean) {
const css = "color: " + (valide ? "green" : "red");
console.log("%c[CHECKING]: %s", css, text);
}
static array(arr: unknown[]) {
console.log("[CORRECTS] ", arr);
}
static response(text: string) {
console.log(text);
}
}
export default Logs;
+15
View File
@@ -0,0 +1,15 @@
/**
* Normlize text
* @param text
*/
function normalizeText(text: string) {
return text
.replace(/\n+/g, "\n")
.replace(/[ \t]+/g, " ")
.toLowerCase()
.trim()
.replace(/^[a-z\d]\.\s/gi, "") //a. text, b. text, c. text, 1. text, 2. text, 3.text
.replace(/\n[a-z\d]\.\s/gi, "\n"); //same but with new line
}
export default normalizeText;
+11
View File
@@ -0,0 +1,11 @@
/**
* Show some informations into the document title and remove it after 3000ms
* @param text
*/
function titleIndications(text: string) {
const backTitle = document.title;
document.title = text;
setTimeout(() => (document.title = backTitle), 3000);
}
export default titleIndications;