Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 13, 2022
1 parent efc6c20 commit 89748fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/config/normalize/lib/wild_wild_path/iterate/duplicate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isSamePathFast, isSameToken } from '../parsing/compare.js'
import { isSamePath, isSameToken } from '../parsing/compare.js'

// Remove duplicate entries
export const removeDuplicates = function (entries) {
Expand All @@ -16,7 +16,7 @@ const isDuplicate = function (
{ path: pathB, queryArray: queryArrayB },
) {
return (
isSamePathFast(pathA, pathB) &&
isSamePath(pathA, pathB) &&
queryArrayA.length === queryArrayB.length &&
queryArrayA.every(
(tokenA, index) =>
Expand Down
5 changes: 0 additions & 5 deletions src/config/normalize/lib/wild_wild_path/parsing/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ const isSameQueryArray = function (queryArrayA, queryArrayB) {
export const isSamePath = function (pathA, pathB) {
validatePath(pathA)
validatePath(pathB)
return isSamePathFast(pathA, pathB)
}

// Same as `equalsSimple()` but without validation
export const isSamePathFast = function (pathA, pathB) {
return (
pathA.length === pathB.length &&
pathA.every((prop, index) => isSameToken(pathB[index], prop))
Expand Down

0 comments on commit 89748fc

Please sign in to comment.