MCPcopy Create free account
hub / github.com/denoland/std / parseFieldNames

Function parseFieldNames

http/unstable_cache_control.ts:210–215  ·  view source on GitHub ↗

Parse a comma-separated list of HTTP field names from a directive argument. * Strips surrounding double quotes if present and unescapes any quoted-pair * sequence (RFC 9110 §5.6.4). Returns an array of trimmed, non-empty field * names.

(value: string)

Source from the content-addressed store, hash-verified

208 * sequence (RFC 9110 §5.6.4). Returns an array of trimmed, non-empty field
209 * names. */
210function parseFieldNames(value: string): string[] {
211 return unquoteArgument(value)
212 .split(",")
213 .map((s) => s.trim())
214 .filter(Boolean);
215}
216
217/**
218 * Parses a `Cache-Control` header value into a typed object. Returns an empty

Callers 1

parseCacheControlFunction · 0.85

Calls 1

unquoteArgumentFunction · 0.85

Tested by

no test coverage detected