feature: client: set-current-by-char: migrate to ESM

This commit is contained in:
coderiaser 2026-01-28 22:52:32 +02:00
parent 4f1a797cd7
commit 3bc49f02f8
3 changed files with 10 additions and 13 deletions

View file

@ -7106,7 +7106,7 @@ with clicks on files.
- Removed allowed from cache property in config.
- Added ability to hide "Upload To" menu item if
no storage modules setted up in modules.json.
no storage modules set up in modules.json.
- From now any file minifying only if last modified
time was changed.
@ -7312,7 +7312,7 @@ in any position in anyLoadOnLoad function.
- Added chainable to Cache object in DOM.
- Changed default ip to null so IP would be geted from
config.json only if it setted up.
config.json only if it set up.
- Fixed bug with starting node from other then projects dir.
@ -7621,7 +7621,7 @@ time was possible.
- Fixed bug with undefined size on root directory of Cloud Commander.
Now Cloud Commander writes size 0, if can't get size, and besides will
setted b char: "0b".
set b char: "0b".
- Added supporting of Russian language in directory names.

View file

@ -5,7 +5,7 @@ import * as Events from '#dom/events';
import * as Buffer from '../dom/buffer.mjs';
import * as KEY from './key.mjs';
import _vim from './vim/index.js';
import setCurrentByChar from './set-current-by-char.js';
import setCurrentByChar from './set-current-by-char.mjs';
import {createBinder} from './binder.mjs';
const Chars = fullstore();

View file

@ -1,14 +1,11 @@
/* global DOM */
import {escapeRegExp} from '../../common/util.js';
'use strict';
const {escapeRegExp} = require('../../common/util');
module.exports = function setCurrentByChar(char, charStore) {
export default function setCurrentByChar(char, charStore) {
const Info = DOM.CurrentInfo;
let firstByName;
let skipCount = 0;
let setted = false;
let set = false;
let i = 0;
const escapeChar = escapeRegExp(char);
@ -36,7 +33,7 @@ module.exports = function setCurrentByChar(char, charStore) {
const byName = DOM.getCurrentByName(name);
if (!skipCount) {
setted = true;
set = true;
DOM.setCurrentFile(byName);
return true;
@ -53,8 +50,8 @@ module.exports = function setCurrentByChar(char, charStore) {
.filter(not(isRoot))
.some(setCurrent);
if (!setted) {
if (!set) {
DOM.setCurrentFile(firstByName);
charStore([char]);
}
};
}