Skip to content

Commit

Permalink
bug: 경로 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonminsang committed Aug 12, 2021
1 parent f1b58f7 commit b80b814
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/lib/router/path-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export const checkPathValidation = (
validatePath: (pathSplit: string[], currentPathSplit: string[]) => boolean,
): boolean => {
const pathSplit = path.split('/');
const currentPathSplit = currentPath.replace(/\/$/, '').split('/');
const currentPathSplit = /^\/$/.test(currentPath)
? currentPath.split('/')
: currentPath.replace(/\/$/, '').split('/');

if (!validatePath(pathSplit, currentPathSplit)) return false;

Expand Down

0 comments on commit b80b814

Please sign in to comment.