Skip to content

refactor: deprecate path wrappers, delegate to CookiePath#599

Open
colincasey wants to merge 4 commits into
cookie-path-typefrom
cookie-path-deprecate-wrappers
Open

refactor: deprecate path wrappers, delegate to CookiePath#599
colincasey wants to merge 4 commits into
cookie-path-typefrom
cookie-path-deprecate-wrappers

Conversation

@colincasey

Copy link
Copy Markdown
Contributor

Summary

  • Extracts test cases into shared fixtures under lib/__tests__/data/
  • Deprecates defaultPath, pathMatch, and permutePath as thin wrappers delegating to the CookiePath const object
  • pathMatch wrapper preserves backward compatibility for non-/-prefixed inputs via an equality fallback
  • All existing behavior is preserved

Part 2 of 3 for #582. Stacked on cookie-path-type (#598).

Next: #cookie-path-internal-callers (migrates internal callers, exports CookiePath)

@colincasey colincasey self-assigned this Apr 27, 2026
@colincasey colincasey marked this pull request as ready for review June 4, 2026 19:32
@colincasey colincasey requested review from awaterma and wjhsf as code owners June 4, 2026 19:32
Comment thread lib/__tests__/defaultPath.spec.ts Outdated
Comment thread lib/cookie/permutePath.ts Outdated
Comment thread lib/__tests__/permutePath.spec.ts Outdated
Comment thread api/tough-cookie.api.md Outdated
@colincasey colincasey force-pushed the cookie-path-deprecate-wrappers branch from f6a0dfc to 9b675f8 Compare July 9, 2026 19:44
CookiePath is an internal seam for migrating to stronger types behind the
existing loose public API — it is intentionally not exported from the package.
The deprecated `defaultPath`/`pathMatch`/`permutePath` wrappers now note they
may be removed in a future major and invite affected users to open an issue,
rather than steering callers to an internal type.
@colincasey colincasey force-pushed the cookie-path-deprecate-wrappers branch from 9b675f8 to 0e9c697 Compare July 9, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants