lint fixes

This commit is contained in:
yoannchb-pro
2024-02-28 15:31:31 -05:00
parent ddc21a654e
commit c43cb8e2de
7 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import reply from "./reply";
type Listener = {
element: HTMLElement;
fn: (this: HTMLElement, ev: MouseEvent) => any;
fn: (this: HTMLElement, ev: MouseEvent) => void;
};
const pressedKeys: string[] = [];
+2
View File
@@ -30,6 +30,8 @@ function questionToAnswerMode(props: Props) {
questionElement.textContent = contentIsResponse
? questionBackup
: props.gptAnswer.response;
contentIsResponse = !contentIsResponse;
});
}
+1 -1
View File
@@ -2,7 +2,7 @@ import type Config from "@typing/config";
import type GPTAnswer from "@typing/gptAnswer";
import Logs from "@utils/logs";
import normalizeText from "@utils/normalize-text";
import { pickBestReponse, toPourcentage } from "@utils/pick-best-response";
import { pickBestReponse } from "@utils/pick-best-response";
/**
* Handle input checkbox elements
+1 -1
View File
@@ -23,7 +23,7 @@ function handleNumber(
}
const number = gptAnswer.normalizedResponse
.match(/\d+([,\.]\d+)?/gi)?.[0]
.match(/\d+([,.]\d+)?/gi)?.[0]
?.replace(",", ".");
if (number === undefined) return false;
+1 -1
View File
@@ -2,7 +2,7 @@ import type Config from "@typing/config";
import type GPTAnswer from "@typing/gptAnswer";
import Logs from "@utils/logs";
import normalizeText from "@utils/normalize-text";
import { pickBestReponse, toPourcentage } from "@utils/pick-best-response";
import { pickBestReponse } from "@utils/pick-best-response";
/**
* Handle input radio elements
+1 -1
View File
@@ -2,7 +2,7 @@ import type Config from "@typing/config";
import type GPTAnswer from "@typing/gptAnswer";
import Logs from "@utils/logs";
import normalizeText from "@utils/normalize-text";
import { pickBestReponse, toPourcentage } from "@utils/pick-best-response";
import { pickBestReponse } from "@utils/pick-best-response";
/**
* Handle select elements (and put in order select)
+1 -1
View File
@@ -5,7 +5,7 @@
function normalizeText(text: string, toLowerCase: boolean = true) {
if (toLowerCase) text = text.toLowerCase();
let normalizedText = text
const normalizedText = text
.replace(/\n+/gi, "\n") //remove duplicate new lines
.replace(/(\n\s*\n)+/g, "\n") //remove useless white space from textcontent
.replace(/[ \t]+/gi, " ") //replace multiples space or tabs by a space