Files
plane/web/core/lib/n-progress/utils/sameURL.ts
T
Prateek ShouryaandGitHub 626464513d chore: add custom n-progress component to fix unwanted n-progress trigger issues. (#4965)
* chore: add n-progress lib.

* chore: prevent unwanted n-progress from projects and notifications.

* fix: lint errors.
2024-06-28 20:39:19 +05:30

17 lines
573 B
TypeScript

export function isSameURL(target: URL, current: URL) {
const cleanTarget =
target.protocol + '//' + target.host + target.pathname + target.search;
const cleanCurrent =
current.protocol + '//' + current.host + current.pathname + current.search;
return cleanTarget === cleanCurrent;
}
export function isSameURLWithoutSearch(target: URL, current: URL) {
const cleanTarget = target.protocol + '//' + target.host + target.pathname;
const cleanCurrent =
current.protocol + '//' + current.host + current.pathname;
return cleanTarget === cleanCurrent;
}