@vaadin/component-base
Advanced tools
Comparing version 24.5.0-alpha9 to 24.5.0-beta1
{ | ||
"name": "@vaadin/component-base", | ||
"version": "24.5.0-alpha9", | ||
"version": "24.5.0-beta1", | ||
"publishConfig": { | ||
@@ -41,7 +41,7 @@ "access": "public" | ||
"devDependencies": { | ||
"@vaadin/chai-plugins": "24.5.0-alpha9", | ||
"@vaadin/chai-plugins": "24.5.0-beta1", | ||
"@vaadin/testing-helpers": "^1.0.0", | ||
"sinon": "^18.0.0" | ||
}, | ||
"gitHead": "804744762f3bec0a2247c4bbcbbb204dbcd78bc0" | ||
"gitHead": "da4b57724d7089e3766d59d01068159322adb2b8" | ||
} |
@@ -12,3 +12,3 @@ /** | ||
get() { | ||
return '24.5.0-alpha9'; | ||
return '24.5.0-beta1'; | ||
}, | ||
@@ -15,0 +15,0 @@ }); |
@@ -22,5 +22,2 @@ /** | ||
/** | ||
* @param {HTMLElement} host | ||
*/ | ||
constructor(query: string, callback: (matches: boolean) => void); | ||
@@ -27,0 +24,0 @@ |
@@ -30,4 +30,5 @@ /** | ||
* @param {string} expected The expected URL to match. | ||
* @param {Object} matchOptions Options for path matching. | ||
*/ | ||
export function matchPaths(actual, expected) { | ||
export function matchPaths(actual, expected, matchOptions = { matchNested: false }) { | ||
const base = document.baseURI; | ||
@@ -37,7 +38,8 @@ const actualUrl = new URL(actual, base); | ||
return ( | ||
actualUrl.origin === expectedUrl.origin && | ||
actualUrl.pathname === expectedUrl.pathname && | ||
containsQueryParams(actualUrl.searchParams, expectedUrl.searchParams) | ||
); | ||
const matchesOrigin = actualUrl.origin === expectedUrl.origin; | ||
const matchesPath = matchOptions.matchNested | ||
? actualUrl.pathname === expectedUrl.pathname || actualUrl.pathname.startsWith(`${expectedUrl.pathname}/`) | ||
: actualUrl.pathname === expectedUrl.pathname; | ||
return matchesOrigin && matchesPath && containsQueryParams(actualUrl.searchParams, expectedUrl.searchParams); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
216309
6409