test: remove useless code

This commit is contained in:
DIYgod
2019-01-29 17:15:02 +08:00
parent 079646387f
commit 6ef8957e8f
6 changed files with 593 additions and 598 deletions

View File

@@ -1,6 +1,4 @@
const pathToRegExp = require('path-to-regexp');
const readall = require('readall');
const crypto = require('crypto');
const paired = (route, path) => {
const options = {
@@ -11,24 +9,6 @@ const paired = (route, path) => {
return pathToRegExp(route, [], options).exec(path);
};
// eslint-disable-next-line no-unused-vars
const read = (stream) =>
new Promise((resolve, reject) => {
readall(stream, (err, data) => {
if (err) {
reject(err);
} else {
resolve(data);
}
});
});
const md5 = (str) =>
crypto
.createHash('md5')
.update(str)
.digest('hex');
const validityCheck = (routes, exclude, path) => {
let match = false;
let routeExpire = false;
@@ -59,7 +39,5 @@ const validityCheck = (routes, exclude, path) => {
module.exports = {
paired,
read,
md5,
validityCheck,
};