chore: lint

This commit is contained in:
coderaiser 2023-07-09 12:43:24 +03:00
parent f1279666b5
commit 4717e035ee
173 changed files with 1388 additions and 1627 deletions

View file

@ -9,7 +9,6 @@ const {btoa} = require('./base64');
const getHeaderField = currify(_getHeaderField);
/* КОНСТАНТЫ (общие для клиента и сервера)*/
/* название программы */
const NAME = 'Cloud Commander';
const FS = '/fs';
@ -41,10 +40,7 @@ module.exports.formatMsg = (msg, name, status) => {
module.exports.getTitle = (options) => {
options = options || {};
const {
path = Path(),
name,
} = options;
const {path = Path(), name} = options;
const array = [
name || NAME,
@ -71,7 +67,10 @@ function getPathLink(url, prefix, template) {
.split('/')
.slice(1, -1);
const allNames = ['/', ...names];
const allNames = [
'/',
...names,
];
const lines = [];
const n = allNames.length;
@ -165,7 +164,7 @@ module.exports.buildFromJSON = (params) => {
Path(path);
fileTable += `${header}<ul data-name="js-files" class="files">`;
/* Если мы не в корне */
if (path !== '/') {
const dotDot = getDotDot(path);
@ -199,7 +198,7 @@ module.exports.buildFromJSON = (params) => {
.map((file) => {
const name = encode(file.name);
const link = prefix + FS + path + name;
const {
type,
mode,
@ -207,17 +206,17 @@ module.exports.buildFromJSON = (params) => {
owner,
size,
} = file;
const linkResult = rendy(templateLink, {
link,
title: name,
name,
attribute: getAttribute(file.type),
});
const dataName = getDataName(file.name);
const attribute = `draggable="true" ${dataName}`;
return rendy(templateFile, {
tag: 'li',
attribute,
@ -249,7 +248,7 @@ function updateField(file) {
function getAttribute(type) {
if (type === 'directory')
return '';
return 'target="_blank" ';
}
@ -286,4 +285,3 @@ function getDotDot(path) {
return dotDot;
}