chore: client: lint

This commit is contained in:
coderiaser 2025-01-20 18:18:52 +02:00
parent 2fc503f71f
commit d8da7922d9
12 changed files with 71 additions and 101 deletions

View file

@ -11,6 +11,7 @@ const load = require('load.js');
const {MAX_FILE_SIZE: maxSize} = require('../../common/cloudfunc');
const {time, timeEnd} = require('../../common/util');
const getEditor = () => editor;
const isFn = (a) => typeof a === 'function';
const loadJS = load.js;
@ -91,10 +92,6 @@ module.exports.show = (options) => {
module.exports.getEditor = getEditor;
function getEditor() {
return editor;
}
module.exports.getElement = () => Element;
module.exports.hide = () => {

View file

@ -46,22 +46,18 @@ module.exports.clear = () => {
konsole.clear();
};
function getPrefix() {
return CloudCmd.prefix + '/console';
}
const getPrefix = () => CloudCmd.prefix + '/console';
function getPrefixSocket() {
return CloudCmd.prefixSocket + '/console';
}
function getEnv() {
return {
ACTIVE_DIR: DOM.getCurrentDirPath.bind(DOM),
PASSIVE_DIR: DOM.getNotCurrentDirPath.bind(DOM),
CURRENT_NAME: DOM.getCurrentName.bind(DOM),
CURRENT_PATH: () => Info.path,
};
}
const getEnv = () => ({
ACTIVE_DIR: DOM.getCurrentDirPath.bind(DOM),
PASSIVE_DIR: DOM.getNotCurrentDirPath.bind(DOM),
CURRENT_NAME: DOM.getCurrentName.bind(DOM),
CURRENT_PATH: () => Info.path,
});
async function onPath(path) {
if (Info.dirPath === path)

View file

@ -226,9 +226,7 @@ function beforeShow(callback, params) {
return isShow;
}
function beforeClick(name) {
return MenuShowedName !== name;
}
const beforeClick = (name) => MenuShowedName !== name;
async function _uploadTo(nameModule) {
const [error, data] = await Info.getData();

View file

@ -75,22 +75,18 @@ function hide() {
CloudCmd.View.hide();
}
function getPrefix() {
return CloudCmd.prefix + '/gritty';
}
const getPrefix = () => CloudCmd.prefix + '/gritty';
function getPrefixSocket() {
return CloudCmd.prefixSocket + '/gritty';
}
function getEnv() {
return {
ACTIVE_DIR: DOM.getCurrentDirPath,
PASSIVE_DIR: DOM.getNotCurrentDirPath,
CURRENT_NAME: DOM.getCurrentName,
CURRENT_PATH: DOM.getCurrentPath,
};
}
const getEnv = () => ({
ACTIVE_DIR: DOM.getCurrentDirPath,
PASSIVE_DIR: DOM.getNotCurrentDirPath,
CURRENT_NAME: DOM.getCurrentName,
CURRENT_PATH: DOM.getCurrentPath,
});
function create(createOptions) {
const {

View file

@ -57,22 +57,18 @@ function hide() {
CloudCmd.View.hide();
}
function getPrefix() {
return CloudCmd.prefix + '/gritty';
}
const getPrefix = () => CloudCmd.prefix + '/gritty';
function getPrefixSocket() {
return CloudCmd.prefixSocket + '/gritty';
}
function getEnv() {
return {
ACTIVE_DIR: DOM.getCurrentDirPath,
PASSIVE_DIR: DOM.getNotCurrentDirPath,
CURRENT_NAME: DOM.getCurrentName,
CURRENT_PATH: DOM.getCurrentPath,
};
}
const getEnv = () => ({
ACTIVE_DIR: DOM.getCurrentDirPath,
PASSIVE_DIR: DOM.getNotCurrentDirPath,
CURRENT_NAME: DOM.getCurrentName,
CURRENT_PATH: DOM.getCurrentPath,
});
function create() {
const options = {

View file

@ -45,9 +45,7 @@ function isMedia(name) {
return isAudio(name) || isVideo(name);
}
function isAudio(name) {
return /\.(mp3|ogg|m4a)$/i.test(name);
}
const isAudio = (name) => /\.(mp3|ogg|m4a)$/i.test(name);
function isVideo(name) {
return /\.(mp4|avi|webm)$/i.test(name);

View file

@ -55,7 +55,10 @@ CloudCmd[Name] = module.exports;
const Info = DOM.CurrentInfo;
const {Key} = CloudCmd;
const basename = (a) => a.split('/').pop();
const basename = (a) => a
.split('/')
.pop();
let El;
let TemplateAudio;

View file

@ -2,6 +2,7 @@
const {extname} = require('node:path');
const currify = require('currify');
const isAudio = (name) => /\.(mp3|ogg|m4a)$/i.test(name);
const testRegExp = currify((name, reg) => reg.test(name));
const getRegExp = (ext) => RegExp(`\\.${ext}$`, 'i');
@ -53,9 +54,6 @@ function isMedia(name) {
}
module.exports.isAudio = isAudio;
function isAudio(name) {
return /\.(mp3|ogg|m4a)$/i.test(name);
}
function isVideo(name) {
return /\.(mp4|avi|webm)$/i.test(name);