(
from: string,
options: { to: string; caseSensitive?: boolean; fuzzy?: boolean },
)
| 356 | path: '/', |
| 357 | }) |
| 358 | const matchPathname = ( |
| 359 | from: string, |
| 360 | options: { to: string; caseSensitive?: boolean; fuzzy?: boolean }, |
| 361 | ) => { |
| 362 | const match = findSingleMatch( |
| 363 | options.to, |
| 364 | options.caseSensitive ?? false, |
| 365 | options.fuzzy ?? false, |
| 366 | from, |
| 367 | processedTree, |
| 368 | ) |
| 369 | const result = match ? match.rawParams : undefined |
| 370 | if (options.to && !result) return |
| 371 | return result ?? {} |
| 372 | } |
| 373 | |
| 374 | describe('matchPathname with optional params', () => { |
| 375 | it.each([ |
no test coverage detected