cloudcmd 16.15.0 → 16.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +6 -6
- package/ChangeLog +17 -0
- package/HELP.md +56 -50
- package/README.md +1 -1
- package/bin/cloudcmd.mjs +20 -23
- package/bin/release.mjs +5 -6
- package/common/base64.js +0 -1
- package/common/callbackify.js +0 -1
- package/common/cloudfunc.js +11 -12
- package/common/entity.js +1 -2
- package/common/try-to-promise-all.js +0 -1
- package/common/util.js +7 -6
- package/dist/cloudcmd.common.js +3 -3
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/cloudcmd.css +1 -1
- package/dist/cloudcmd.js +1 -1
- package/dist/cloudcmd.js.map +1 -1
- package/dist/modules/config.js +1 -1
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/contact.js +1 -1
- package/dist/modules/contact.js.map +1 -1
- package/dist/modules/edit.js +2 -2
- package/dist/modules/edit.js.map +1 -1
- package/dist/modules/markdown.js +1 -1
- package/dist/modules/markdown.js.map +1 -1
- package/dist/modules/menu.js +1 -1
- package/dist/modules/menu.js.map +1 -1
- package/dist/modules/operation.js +1 -1
- package/dist/modules/operation.js.map +1 -1
- package/dist/modules/terminal-run.js +1 -1
- package/dist/modules/terminal-run.js.map +1 -1
- package/dist/modules/terminal.js +1 -1
- package/dist/modules/terminal.js.map +1 -1
- package/dist/modules/upload.js +1 -1
- package/dist/modules/upload.js.map +1 -1
- package/dist/modules/user-menu.js +1 -1
- package/dist/modules/user-menu.js.map +1 -1
- package/dist/modules/view.js +1 -1
- package/dist/modules/view.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist-dev/cloudcmd.common.js +21 -21
- package/dist-dev/cloudcmd.css +1 -1
- package/dist-dev/cloudcmd.js +7 -7
- package/dist-dev/modules/config.js +1 -1
- package/dist-dev/modules/contact.js +1 -1
- package/dist-dev/modules/edit.js +1 -1
- package/dist-dev/modules/markdown.js +1 -1
- package/dist-dev/modules/menu.js +1 -1
- package/dist-dev/modules/operation.js +2 -2
- package/dist-dev/modules/terminal-run.js +1 -1
- package/dist-dev/modules/terminal.js +1 -1
- package/dist-dev/modules/upload.js +1 -1
- package/dist-dev/modules/user-menu.js +2 -2
- package/dist-dev/modules/view.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/package.json +11 -10
- package/server/auth.js +2 -2
- package/server/cloudcmd.js +2 -17
- package/server/columns.js +2 -2
- package/server/config.js +8 -5
- package/server/distribute/export.js +8 -7
- package/server/distribute/import.js +29 -34
- package/server/distribute/log.js +0 -1
- package/server/env.js +4 -5
- package/server/exit.js +0 -1
- package/server/markdown/index.js +2 -4
- package/server/markdown/worker.js +1 -0
- package/server/modulas.js +0 -1
- package/server/prefixer.js +3 -2
- package/server/repl.js +18 -17
- package/server/rest/index.js +13 -13
- package/server/rest/info.js +0 -1
- package/server/root.js +0 -1
- package/server/route.js +11 -15
- package/server/server.mjs +3 -9
- package/server/show-config.js +6 -2
- package/server/template.js +0 -1
- package/server/terminal.js +0 -1
- package/server/user-menu.js +4 -5
- package/server/validate.js +2 -2
- package/static/user-menu.js +53 -37
package/CONTRIBUTING.md
CHANGED
|
@@ -4,12 +4,12 @@ Format of the commit message: **type(scope) subject**
|
|
|
4
4
|
|
|
5
5
|
**Type**:
|
|
6
6
|
|
|
7
|
-
- feature
|
|
8
|
-
- fix
|
|
9
|
-
- docs
|
|
10
|
-
- refactor
|
|
11
|
-
- test
|
|
12
|
-
- chore
|
|
7
|
+
- feature: scope: subject
|
|
8
|
+
- fix: scope: subject
|
|
9
|
+
- docs: scope: subject
|
|
10
|
+
- refactor: scope: subject
|
|
11
|
+
- test: scope: subject
|
|
12
|
+
- chore: scope: subject
|
|
13
13
|
|
|
14
14
|
**Scope**:
|
|
15
15
|
Scope could be anything specifying place of the commit change.
|
package/ChangeLog
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
2023.08.07, v16.16.1
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- d63169cc package: @putout/babel v1.0.5
|
|
5
|
+
- bb9276be package: eslint-plugin-putout v19.0.3
|
|
6
|
+
- 9aed5f75 package: putout v31.0.3
|
|
7
|
+
|
|
8
|
+
2023.07.09, v16.16.0
|
|
9
|
+
|
|
10
|
+
feature:
|
|
11
|
+
- c4f56c59 package: memfs v4.2.0
|
|
12
|
+
- 0e663e1d package: @putout/plugin-cloudcmd v3.1.1
|
|
13
|
+
- ff9265b7 package: c8 v8.0.0
|
|
14
|
+
- 22aa337a package: eslint-plugin-n v16.0.1
|
|
15
|
+
- 13350b55 package: eslint-plugin-putout v18.0.0
|
|
16
|
+
- ce196abf package: putout v30.1.1
|
|
17
|
+
|
|
1
18
|
2023.05.17, v16.15.0
|
|
2
19
|
|
|
3
20
|
feature:
|
package/HELP.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cloud Commander v16.
|
|
1
|
+
# Cloud Commander v16.16.1
|
|
2
2
|
|
|
3
3
|
### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
|
|
4
4
|
|
|
@@ -374,50 +374,50 @@ Here's a description of all options:
|
|
|
374
374
|
|
|
375
375
|
```json
|
|
376
376
|
{
|
|
377
|
-
"name"
|
|
378
|
-
"auth"
|
|
379
|
-
"username"
|
|
380
|
-
"password"
|
|
381
|
-
"algo"
|
|
382
|
-
"editor"
|
|
383
|
-
"packer"
|
|
384
|
-
"diff"
|
|
385
|
-
"zip"
|
|
386
|
-
"buffer"
|
|
387
|
-
"dirStorage"
|
|
388
|
-
"online"
|
|
389
|
-
"open"
|
|
390
|
-
"oneFilePanel"
|
|
391
|
-
"keysPanel"
|
|
392
|
-
"port"
|
|
393
|
-
"ip"
|
|
394
|
-
"root"
|
|
395
|
-
"prefix"
|
|
396
|
-
"prefixSocket"
|
|
397
|
-
"confirmCopy"
|
|
398
|
-
"confirmMove"
|
|
399
|
-
"showConfig"
|
|
400
|
-
"showFileName"
|
|
401
|
-
"contact"
|
|
402
|
-
"configDialog"
|
|
403
|
-
"configAuth"
|
|
404
|
-
"console"
|
|
405
|
-
"syncConsolePath"
|
|
406
|
-
"terminal"
|
|
407
|
-
"terminalPath"
|
|
408
|
-
"terminalCommand"
|
|
409
|
-
"terminalAutoRestart"
|
|
410
|
-
"vim"
|
|
411
|
-
"columns"
|
|
412
|
-
"export"
|
|
413
|
-
"exportToken"
|
|
414
|
-
"import"
|
|
415
|
-
"import-url"
|
|
416
|
-
"importToken"
|
|
417
|
-
"importListen"
|
|
418
|
-
"dropbox"
|
|
419
|
-
"dropboxToken"
|
|
420
|
-
"log"
|
|
377
|
+
"name": "", // set tab name in web browser
|
|
378
|
+
"auth": false, // enable http authentication
|
|
379
|
+
"username": "root", // username for authentication
|
|
380
|
+
"password": "toor", // password hash for authentication
|
|
381
|
+
"algo": "sha512WithRSAEncryption", // cryptographic algorithm
|
|
382
|
+
"editor": "edward", // default, could be "dword" or "edward"
|
|
383
|
+
"packer": "tar", // default, could be "tar" or "zip"
|
|
384
|
+
"diff": true, // when save - send patch, not whole file
|
|
385
|
+
"zip": true, // zip text before send / unzip before save
|
|
386
|
+
"buffer": true, // buffer for copying files
|
|
387
|
+
"dirStorage": true, // store directory listing
|
|
388
|
+
"online": false, // do not load js files from cdn
|
|
389
|
+
"open": true, // open web browser when server started
|
|
390
|
+
"oneFilePanel": false, // show one file panel
|
|
391
|
+
"keysPanel": true, // show classic panel with buttons of keys
|
|
392
|
+
"port": 8000, // http port
|
|
393
|
+
"ip": null, // ip or null(default)
|
|
394
|
+
"root": "/", // root directory
|
|
395
|
+
"prefix": "", // url prefix
|
|
396
|
+
"prefixSocket": "", // prefix for socket connection
|
|
397
|
+
"confirmCopy": true, // confirm copy
|
|
398
|
+
"confirmMove": true, // confirm move
|
|
399
|
+
"showConfig": false, // show config at startup
|
|
400
|
+
"showFileName": false, // do not show file name in view and edit
|
|
401
|
+
"contact": true, // enable contact
|
|
402
|
+
"configDialog": true, // enable config dialog
|
|
403
|
+
"configAuth": true, // enable auth change in config dialog
|
|
404
|
+
"console": true, // enable console
|
|
405
|
+
"syncConsolePath": false, // do not sync console path
|
|
406
|
+
"terminal": false, // disable terminal
|
|
407
|
+
"terminalPath": "", // path of a terminal
|
|
408
|
+
"terminalCommand": "", // set command to run in terminal
|
|
409
|
+
"terminalAutoRestart": true, // restart command on exit
|
|
410
|
+
"vim": false, // disable vim hot keys
|
|
411
|
+
"columns": "name-size-date-owner-mode", // set visible columns
|
|
412
|
+
"export": false, // enable export of config through a server
|
|
413
|
+
"exportToken": "root", // token used by export server
|
|
414
|
+
"import": false, // enable import of config
|
|
415
|
+
"import-url": "http://localhost:8000", // url of an export server
|
|
416
|
+
"importToken": "root", // token used to connect to export server
|
|
417
|
+
"importListen": false, // listen on config updates
|
|
418
|
+
"dropbox": false, // disable dropbox integration
|
|
419
|
+
"dropboxToken": "", // unset dropbox token
|
|
420
|
+
"log": true // logging
|
|
421
421
|
}
|
|
422
422
|
```
|
|
423
423
|
|
|
@@ -467,9 +467,7 @@ const RENAME_FILE = 'Rename file';
|
|
|
467
467
|
|
|
468
468
|
export default {
|
|
469
469
|
'__settings': {
|
|
470
|
-
select: [
|
|
471
|
-
RENAME_FILE,
|
|
472
|
-
],
|
|
470
|
+
select: [RENAME_FILE],
|
|
473
471
|
run: false,
|
|
474
472
|
},
|
|
475
473
|
[`F2 - ${RENAME_FILE}`]: async ({DOM}) => {
|
|
@@ -499,7 +497,10 @@ export default {
|
|
|
499
497
|
const path = `${dirPath}.cloudcmd.menu.js`;
|
|
500
498
|
const {prefix} = CloudCmd;
|
|
501
499
|
|
|
502
|
-
const data = await readDefaultMenu({
|
|
500
|
+
const data = await readDefaultMenu({
|
|
501
|
+
prefix,
|
|
502
|
+
});
|
|
503
|
+
|
|
503
504
|
await createDefaultMenu({
|
|
504
505
|
path,
|
|
505
506
|
data,
|
|
@@ -743,6 +744,7 @@ const socket2 = new Server(server, {
|
|
|
743
744
|
});
|
|
744
745
|
|
|
745
746
|
const configManager1 = createConfigManager();
|
|
747
|
+
|
|
746
748
|
configManager1('name', '1');
|
|
747
749
|
|
|
748
750
|
const configManager2 = createConfigManager();
|
|
@@ -765,8 +767,10 @@ If you want to enable authorization, you can pass credentials to Cloud Commander
|
|
|
765
767
|
|
|
766
768
|
```js
|
|
767
769
|
import criton from 'criton';
|
|
768
|
-
const algo = 'sha512WithRSAEncryption'; // default
|
|
769
770
|
|
|
771
|
+
const algo = 'sha512WithRSAEncryption';
|
|
772
|
+
|
|
773
|
+
// default
|
|
770
774
|
// you can generate a hash dynamically
|
|
771
775
|
const password = criton('root', algo);
|
|
772
776
|
|
|
@@ -1089,6 +1093,8 @@ There are a lot of ways to be involved in `Cloud Commander` development:
|
|
|
1089
1093
|
|
|
1090
1094
|
## Version history
|
|
1091
1095
|
|
|
1096
|
+
- *2023.08.07*, **[v16.16.1](//github.com/coderaiser/cloudcmd/releases/tag/v16.16.1)**
|
|
1097
|
+
- *2023.07.09*, **[v16.16.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.16.0)**
|
|
1092
1098
|
- *2023.05.17*, **[v16.15.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.15.0)**
|
|
1093
1099
|
- *2023.03.21*, **[v16.14.1](//github.com/coderaiser/cloudcmd/releases/tag/v16.14.1)**
|
|
1094
1100
|
- *2023.03.08*, **[v16.14.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.14.0)**
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cloud Commander v16.
|
|
1
|
+
# Cloud Commander v16.16.1 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
|
|
2
2
|
|
|
3
3
|
### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
|
|
4
4
|
|
package/bin/cloudcmd.mjs
CHANGED
|
@@ -5,13 +5,11 @@ import {promisify} from 'util';
|
|
|
5
5
|
import tryToCatch from 'try-to-catch';
|
|
6
6
|
import {createSimport} from 'simport';
|
|
7
7
|
import parse from 'yargs-parser';
|
|
8
|
-
|
|
9
8
|
import exit from '../server/exit.js';
|
|
10
9
|
import {
|
|
11
10
|
createConfig,
|
|
12
11
|
configPath,
|
|
13
12
|
} from '../server/config.js';
|
|
14
|
-
|
|
15
13
|
import env from '../server/env.js';
|
|
16
14
|
import prefixer from '../server/prefixer.js';
|
|
17
15
|
|
|
@@ -100,29 +98,29 @@ const yargsOptions = {
|
|
|
100
98
|
'dropbox',
|
|
101
99
|
],
|
|
102
100
|
default: {
|
|
103
|
-
'server'
|
|
104
|
-
'name'
|
|
105
|
-
'auth'
|
|
106
|
-
'port'
|
|
107
|
-
'online'
|
|
108
|
-
'open'
|
|
109
|
-
'editor'
|
|
110
|
-
'packer'
|
|
111
|
-
'zip'
|
|
112
|
-
'username'
|
|
113
|
-
'root'
|
|
114
|
-
'prefix'
|
|
115
|
-
'console'
|
|
116
|
-
'contact'
|
|
117
|
-
'terminal'
|
|
118
|
-
'columns'
|
|
119
|
-
'vim'
|
|
120
|
-
'log'
|
|
101
|
+
'server': true,
|
|
102
|
+
'name': choose(env('name'), config('name')),
|
|
103
|
+
'auth': choose(env.bool('auth'), config('auth')),
|
|
104
|
+
'port': config('port'),
|
|
105
|
+
'online': config('online'),
|
|
106
|
+
'open': choose(env.bool('open'), config('open')),
|
|
107
|
+
'editor': env('editor') || config('editor'),
|
|
108
|
+
'packer': config('packer') || 'tar',
|
|
109
|
+
'zip': config('zip'),
|
|
110
|
+
'username': env('username') || config('username'),
|
|
111
|
+
'root': choose(env('root'), config('root')),
|
|
112
|
+
'prefix': choose(env('prefix'), config('prefix')),
|
|
113
|
+
'console': choose(env.bool('console'), config('console')),
|
|
114
|
+
'contact': choose(env.bool('contact'), config('contact')),
|
|
115
|
+
'terminal': choose(env.bool('terminal'), config('terminal')),
|
|
116
|
+
'columns': env('columns') || config('columns') || '',
|
|
117
|
+
'vim': choose(env.bool('vim'), config('vim')),
|
|
118
|
+
'log': config('log'),
|
|
121
119
|
|
|
122
120
|
'import-url': env('import_url') || config('importUrl'),
|
|
123
121
|
'import-listen': choose(env.bool('import_listen'), config('importListen')),
|
|
124
|
-
'import'
|
|
125
|
-
'export'
|
|
122
|
+
'import': choose(env.bool('import'), config('import')),
|
|
123
|
+
'export': choose(env.bool('export'), config('export')),
|
|
126
124
|
|
|
127
125
|
'prefix-socket': config('prefixSocket'),
|
|
128
126
|
'show-file-name': choose(env.bool('show_file_name'), config('showFileName')),
|
|
@@ -348,4 +346,3 @@ async function showUpdateInfo(version) {
|
|
|
348
346
|
|
|
349
347
|
console.log('%s %s', latest, current);
|
|
350
348
|
}
|
|
351
|
-
|
package/bin/release.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import {promisify} from 'util';
|
|
4
|
-
|
|
5
4
|
import tryToCatch from 'try-to-catch';
|
|
6
5
|
import {createSimport} from 'simport';
|
|
7
6
|
import minor from 'minor';
|
|
@@ -20,8 +19,9 @@ async function main() {
|
|
|
20
19
|
const history = '## Version history\n\n';
|
|
21
20
|
const link = '//github.com/coderaiser/cloudcmd/releases/tag/';
|
|
22
21
|
const template = '- *{{ date }}*, ' +
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
'**[v{{ version }}]' +
|
|
23
|
+
'(' + link +
|
|
24
|
+
'v{{ version }})**\n';
|
|
25
25
|
|
|
26
26
|
const {version} = Info;
|
|
27
27
|
|
|
@@ -34,8 +34,8 @@ async function main() {
|
|
|
34
34
|
await replaceVersion('HELP.md', version, versionNew);
|
|
35
35
|
|
|
36
36
|
const historyNew = history + rendy(template, {
|
|
37
|
-
date
|
|
38
|
-
version
|
|
37
|
+
date: shortdate(),
|
|
38
|
+
version: versionNew,
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
await replaceVersion('HELP.md', history, historyNew);
|
|
@@ -71,4 +71,3 @@ function getVersionNew(last, match) {
|
|
|
71
71
|
|
|
72
72
|
return last.substr(3);
|
|
73
73
|
}
|
|
74
|
-
|
package/common/base64.js
CHANGED
package/common/callbackify.js
CHANGED
package/common/cloudfunc.js
CHANGED
|
@@ -9,7 +9,6 @@ const {btoa} = require('./base64');
|
|
|
9
9
|
const getHeaderField = currify(_getHeaderField);
|
|
10
10
|
|
|
11
11
|
/* КОНСТАНТЫ (общие для клиента и сервера)*/
|
|
12
|
-
|
|
13
12
|
/* название программы */
|
|
14
13
|
const NAME = 'Cloud Commander';
|
|
15
14
|
const FS = '/fs';
|
|
@@ -41,10 +40,7 @@ module.exports.formatMsg = (msg, name, status) => {
|
|
|
41
40
|
module.exports.getTitle = (options) => {
|
|
42
41
|
options = options || {};
|
|
43
42
|
|
|
44
|
-
const {
|
|
45
|
-
path = Path(),
|
|
46
|
-
name,
|
|
47
|
-
} = options;
|
|
43
|
+
const {path = Path(), name} = options;
|
|
48
44
|
|
|
49
45
|
const array = [
|
|
50
46
|
name || NAME,
|
|
@@ -71,7 +67,11 @@ function getPathLink(url, prefix, template) {
|
|
|
71
67
|
.split('/')
|
|
72
68
|
.slice(1, -1);
|
|
73
69
|
|
|
74
|
-
const allNames = [
|
|
70
|
+
const allNames = [
|
|
71
|
+
'/',
|
|
72
|
+
...names,
|
|
73
|
+
];
|
|
74
|
+
|
|
75
75
|
const lines = [];
|
|
76
76
|
const n = allNames.length;
|
|
77
77
|
|
|
@@ -165,7 +165,7 @@ module.exports.buildFromJSON = (params) => {
|
|
|
165
165
|
Path(path);
|
|
166
166
|
|
|
167
167
|
fileTable += `${header}<ul data-name="js-files" class="files">`;
|
|
168
|
-
|
|
168
|
+
|
|
169
169
|
/* Если мы не в корне */
|
|
170
170
|
if (path !== '/') {
|
|
171
171
|
const dotDot = getDotDot(path);
|
|
@@ -199,7 +199,7 @@ module.exports.buildFromJSON = (params) => {
|
|
|
199
199
|
.map((file) => {
|
|
200
200
|
const name = encode(file.name);
|
|
201
201
|
const link = prefix + FS + path + name;
|
|
202
|
-
|
|
202
|
+
|
|
203
203
|
const {
|
|
204
204
|
type,
|
|
205
205
|
mode,
|
|
@@ -207,17 +207,17 @@ module.exports.buildFromJSON = (params) => {
|
|
|
207
207
|
owner,
|
|
208
208
|
size,
|
|
209
209
|
} = file;
|
|
210
|
-
|
|
210
|
+
|
|
211
211
|
const linkResult = rendy(templateLink, {
|
|
212
212
|
link,
|
|
213
213
|
title: name,
|
|
214
214
|
name,
|
|
215
215
|
attribute: getAttribute(file.type),
|
|
216
216
|
});
|
|
217
|
-
|
|
217
|
+
|
|
218
218
|
const dataName = getDataName(file.name);
|
|
219
219
|
const attribute = `draggable="true" ${dataName}`;
|
|
220
|
-
|
|
220
|
+
|
|
221
221
|
return rendy(templateFile, {
|
|
222
222
|
tag: 'li',
|
|
223
223
|
attribute,
|
|
@@ -286,4 +286,3 @@ function getDotDot(path) {
|
|
|
286
286
|
|
|
287
287
|
return dotDot;
|
|
288
288
|
}
|
|
289
|
-
|
package/common/entity.js
CHANGED
package/common/util.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const exec = require('execon');
|
|
4
|
+
const isString = (a) => typeof a === 'string';
|
|
4
5
|
|
|
5
6
|
module.exports.escapeRegExp = (str) => {
|
|
6
|
-
const isStr =
|
|
7
|
+
const isStr = isString(str);
|
|
7
8
|
|
|
8
9
|
if (isStr)
|
|
9
10
|
str = str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
@@ -16,15 +17,16 @@ module.exports.escapeRegExp = (str) => {
|
|
|
16
17
|
*/
|
|
17
18
|
module.exports.getRegExp = (wildcard) => {
|
|
18
19
|
const escaped = `^${wildcard // search from start of line
|
|
20
|
+
|
|
19
21
|
.replace(/\./g, '\\.')
|
|
20
22
|
.replace(/\*/g, '.*')
|
|
21
|
-
.replace('?', '.?')}$`;
|
|
23
|
+
.replace('?', '.?')}$`;
|
|
22
24
|
|
|
25
|
+
// search to end of line
|
|
23
26
|
return RegExp(escaped);
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
module.exports.exec = exec;
|
|
27
|
-
|
|
28
30
|
/**
|
|
29
31
|
* function gets file extension
|
|
30
32
|
*
|
|
@@ -32,7 +34,7 @@ module.exports.exec = exec;
|
|
|
32
34
|
* @return ext
|
|
33
35
|
*/
|
|
34
36
|
module.exports.getExt = (name) => {
|
|
35
|
-
const isStr =
|
|
37
|
+
const isStr = isString(name);
|
|
36
38
|
|
|
37
39
|
if (!isStr)
|
|
38
40
|
return '';
|
|
@@ -57,7 +59,7 @@ module.exports.findObjByNameInArr = (array, name) => {
|
|
|
57
59
|
if (!Array.isArray(array))
|
|
58
60
|
throw Error('array should be array!');
|
|
59
61
|
|
|
60
|
-
if (
|
|
62
|
+
if (!isString(name))
|
|
61
63
|
throw Error('name should be string!');
|
|
62
64
|
|
|
63
65
|
array.some((item) => {
|
|
@@ -100,4 +102,3 @@ module.exports.time = (name) => {
|
|
|
100
102
|
module.exports.timeEnd = (name) => {
|
|
101
103
|
exec.ifExist(console, 'timeEnd', [name]);
|
|
102
104
|
};
|
|
103
|
-
|