v1.0.0
This commit is contained in:
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user