lib: remove useless file

This commit is contained in:
DIYgod 2019-01-31 17:30:30 +08:00
parent d0d3b69d27
commit c08d4481f0
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 0 additions and 43 deletions

View File

@ -1,43 +0,0 @@
const pathToRegExp = require('path-to-regexp');
const paired = (route, path) => {
const options = {
sensitive: true,
strict: true,
};
return pathToRegExp(route, [], options).exec(path);
};
const validityCheck = (routes, exclude, path) => {
let match = false;
let routeExpire = false;
for (let i = 0; i < routes.length; i++) {
let route = routes[i];
if (typeof routes[i] === 'object') {
route = routes[i].path;
routeExpire = routes[i].expire;
}
if (paired(route, path)) {
match = true;
break;
}
}
for (let j = 0; j < exclude.length; j++) {
if (paired(exclude[j], path)) {
match = false;
break;
}
}
return { match, routeExpire };
};
module.exports = {
paired,
validityCheck,
};