Versioned project notes for @stackline/parse-link-header 1.0.4. Original attribution is retained in the linked repository.
Compatibility Contract
Baseline
The behavioral baseline is [email protected].
Preserved
module.exports = parseLinkHeaderand one-argument calls.- Empty values and silently rejected over-limit headers return
null. - Valid headers return plain objects keyed by relation.
- URL query parameters are included and extension parameters override them.
- Every link includes
urlandrel. - Repeated query parameters become arrays.
- Space-separated relation values create one output entry per token.
- A later link replaces an earlier link with the same relation.
- The 2,000-character default and both historical environment variables.
- CommonJS root,
index, andindex.jsimports.
Additive
- default and named native ESM exports;
- first-party TypeScript declarations;
maxHeaderLengthandthrowOnMaxHeaderLengthExceededper-call options;- browser execution without
process,url, orquerystringpolyfills.
Intentional corrections
__proto__,prototype, andconstructorfrom untrusted parser fields are ignored instead of being assigned to ordinary objects.- quoted extension values retain delimiters and escaped quotes;
- whitespace around parameter names and equals signs is accepted;
- malformed individual links are ignored without aborting valid siblings.
The output shape is intentionally not replaced by a spec-oriented class or an array. Packages requiring a different RFC 8288 model should use a dedicated Link-header implementation instead of assuming drop-in compatibility.