You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Replace direct parameter-pair matching with a dedicated memoised factory
that caches cardinality per acceptable→available pair using
reference-equality keys for faster repeated comparisons.
* Add fast-path check for empty parameter lists to avoid unnecessary work.
* Replace mutable local names with clearer identifiers and switch to a
WeakMap-style WM for mapping acceptable→available.
* Use the memoised cardinality function in both sorting and final ranking to
ensure consistent and cheaper overlap calculations.
* Small renames and code structure changes to make intent and caching explicit.
* Use Readonly for parsed inputs and Readonly keys in the qMap to reflect
intent and prevent accidental mutation.
* Sort and compare using cached cardinalities rather than recomputing full
overlapping-parameter lists, reducing allocation and CPU overhead in the
common negotiation path.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@apeleghq/http-media-type-negotiator",
3
-
"version": "1.0.7",
3
+
"version": "1.0.8",
4
4
"description": "RFC-aware HTTP media type negotiator - parses and normalises Accept headers and media types (RFC 9110), supports q-value ranking, wildcard matching, and a permissive mode for real-world headers.",
0 commit comments