mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix lint
This commit is contained in:
1 parent
a68537cb30
commit
10a1de0741
2 files changed
+1
-4
No files matched your search
@@ -1,9 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
const versionNum = +process.version.replace(/v/gim, '').split('.')[0];
|
const versionNum = +process.version.replace(/v/gim, '').split('.')[0];
|
||||||
if (versionNum < 14) throw new Error('NodeJS >=v14 required');
|
if (versionNum < 14) throw new Error('NodeJS >=v14 required');
|
||||||
|
|
||||||
|
|
||||||
if (!global.Hydro) {
|
if (!global.Hydro) {
|
||||||
global.Hydro = {
|
global.Hydro = {
|
||||||
version: {
|
version: {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export class StorageModel {
|
|||||||
? await StorageModel.coll.find({ path: { $regex: new RegExp(`^${escapeRegExp(target)}`, 'i') } }).toArray()
|
? await StorageModel.coll.find({ path: { $regex: new RegExp(`^${escapeRegExp(target)}`, 'i') } }).toArray()
|
||||||
: await StorageModel.coll.find({ path: { $regex: new RegExp(`^${escapeRegExp(target)}[^/]+$`) } }).toArray();
|
: await StorageModel.coll.find({ path: { $regex: new RegExp(`^${escapeRegExp(target)}[^/]+$`) } }).toArray();
|
||||||
return results.map((i) => ({
|
return results.map((i) => ({
|
||||||
...i, name: i.path, prefix: i.path.split(target)[1],
|
...i, name: i.path.split(target)[1], prefix: target,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user