forked from mirror/MCSM-Daemon
Merge branch 'master' of https://github.com/MCSManager/Daemon
This commit is contained in:
commit
cd20dce278
53
package-lock.json
generated
53
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mcsmanager-daemon",
|
||||
"version": "3.3.0",
|
||||
"version": "3.4.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -456,6 +456,15 @@
|
||||
"@types/koa": "*"
|
||||
}
|
||||
},
|
||||
"@types/koa-send": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/koa-send/-/koa-send-4.1.3.tgz",
|
||||
"integrity": "sha512-daaTqPZlgjIJycSTNjKpHYuKhXYP30atFc1pBcy6HHqB9+vcymDgYTguPdx9tO4HMOqNyz6bz/zqpxt5eLR+VA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/koa": "*"
|
||||
}
|
||||
},
|
||||
"@types/koa__router": {
|
||||
"version": "8.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.7.tgz",
|
||||
@ -2411,6 +2420,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"koa-send": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz",
|
||||
"integrity": "sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==",
|
||||
"requires": {
|
||||
"debug": "^4.1.1",
|
||||
"http-errors": "^1.7.3",
|
||||
"resolve-path": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"lazystream": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
|
||||
@ -3093,6 +3112,38 @@
|
||||
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
|
||||
"dev": true
|
||||
},
|
||||
"resolve-path": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz",
|
||||
"integrity": "sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==",
|
||||
"requires": {
|
||||
"http-errors": "~1.6.2",
|
||||
"path-is-absolute": "1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"http-errors": {
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
|
||||
"integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==",
|
||||
"requires": {
|
||||
"depd": "~1.1.2",
|
||||
"inherits": "2.0.3",
|
||||
"setprototypeof": "1.1.0",
|
||||
"statuses": ">= 1.4.0 < 2"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
|
||||
},
|
||||
"setprototypeof": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
|
||||
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"rfdc": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz",
|
||||
|
@ -72,7 +72,7 @@ export default class FileManager {
|
||||
list(page: 0, pageSize = 40, searchFileName?: string) {
|
||||
if (pageSize > 100 || pageSize <= 0 || page < 0) throw new Error("Beyond the value limit");
|
||||
let fileNames = fs.readdirSync(this.toAbsolutePath());
|
||||
if (searchFileName) fileNames = fileNames.filter((name) => name.includes(searchFileName));
|
||||
if (searchFileName) fileNames = fileNames.filter((name) => name.toLowerCase().includes(searchFileName.toLowerCase()));
|
||||
|
||||
const total = fileNames.length;
|
||||
const sliceStart = page * pageSize;
|
||||
|
Loading…
Reference in New Issue
Block a user