mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 01:55:40 +00:00
frontend linting
This commit is contained in:
@@ -15,13 +15,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Level} from './index';
|
||||
import CONST from '../const';
|
||||
import { Level } from "./index";
|
||||
import CONST from "../const";
|
||||
|
||||
import log from '../../../../../logger';
|
||||
import log from "../../../../../logger";
|
||||
|
||||
/** Fetches level from DOM using the ID passesd and validates */
|
||||
const getLevelFields = (id: number) => {
|
||||
const getLevelFields = (id: number): Level => {
|
||||
log.debug(`[getLevelFields]: id: ${id}`);
|
||||
const visitorID = CONST.VISITOR_WITHOUT_LEVEL + id.toString();
|
||||
const difficultyID = CONST.DIFFICULTY_WITHOUT_LEVEL + id.toString();
|
||||
@@ -35,11 +35,11 @@ const getLevelFields = (id: number) => {
|
||||
const difficulty_factor = parseInt(difficultyElement.value);
|
||||
|
||||
if (Number.isNaN(visitor_threshold)) {
|
||||
throw new Error('visitor can contain nubers only');
|
||||
throw new Error("visitor can contain nubers only");
|
||||
}
|
||||
|
||||
if (Number.isNaN(difficulty_factor)) {
|
||||
throw new Error('difficulty can contain nubers only');
|
||||
throw new Error("difficulty can contain nubers only");
|
||||
}
|
||||
|
||||
const level: Level = {
|
||||
@@ -48,7 +48,7 @@ const getLevelFields = (id: number) => {
|
||||
};
|
||||
|
||||
log.debug(
|
||||
`[getLevelFields.ts] visitor: ${visitor_threshold} difficulty: ${difficulty_factor}`,
|
||||
`[getLevelFields.ts] visitor: ${visitor_threshold} difficulty: ${difficulty_factor}`
|
||||
);
|
||||
|
||||
return level;
|
||||
|
||||
Reference in New Issue
Block a user