lint fixes
This commit is contained in:
@@ -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[] = [];
|
||||
|
||||
@@ -30,6 +30,8 @@ function questionToAnswerMode(props: Props) {
|
||||
questionElement.textContent = contentIsResponse
|
||||
? questionBackup
|
||||
: props.gptAnswer.response;
|
||||
|
||||
contentIsResponse = !contentIsResponse;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user