mirror: Blazing fast w3c Trace Contexts for any JS runtime
0

Configure Feed

Select the types of activity you want to include in your feed.

chore: whoops docblock comments broken

Marais Rossouw (Jun 26, 2026, 1:15 PM +1000) d4967fec a311104e

+3 -3
+3 -3
lib/tracestate.ts
··· 2 2 * A simple implementation of the {@link https://www.w3.org/TR/trace-context-2/|W3C Trace Context specification level 2}. 3 3 * 4 4 * This module provides a simple API for creating, parsing, and manipulating tracestate headers. You will probably also 5 - * be relying on the {@link {import('./traceparent.ts')}} module to create and parse traceparent headers. 5 + * be relying on the {@link import('./traceparent.ts')} module to create and parse traceparent headers. 6 6 * 7 7 * Tracestates are effectivly a ring buffer of 32 key-value pairs, where the key is a string of up to 256 characters and 8 8 * the value is a string of up to 256 characters. The key must be unique within the tracestate. 9 9 * 10 - * Updateing the tracestate is done by calling the {@link {Tracestate.set}} method, which will update the value of the 10 + * Updateing the tracestate is done by calling the {@link Tracestate.set} method, which will update the value of the 11 11 * key if it exists (and move it to the front), or prepend a new key-value pair to the front of the tracestate. If the 12 12 * tracestate is full, the oldest key-value pair will be removed. 13 13 * ··· 19 19 * let traceparent, tracestate, tmp; 20 20 * tmp = req.headers.get('traceparent'); 21 21 * if (tmp) traceparent = ts.parse(tmp); 22 - 22 + * 23 23 * tmp = req.headers.get('tracestate'); 24 24 * // only parse the tracestate, if we have a valid parsed traceparent, as per spec 25 25 * if (traceparent && tmp) tracestate = ts.parse(tmp);