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

Function parseAcceptLanguage

http/_negotiation/language.ts:73–84  ·  view source on GitHub ↗
(accept: string)

Source from the content-addressed store, hash-verified

71}
72
73function parseAcceptLanguage(accept: string): LanguageSpecificity[] {
74 const accepts = accept.split(",");
75 const result: LanguageSpecificity[] = [];
76
77 for (const [i, accept] of accepts.entries()) {
78 const language = parseLanguage(accept.trim(), i);
79 if (language) {
80 result.push(language);
81 }
82 }
83 return result;
84}
85
86function specify(
87 language: string,

Callers 1

preferredLanguagesFunction · 0.85

Calls 3

parseLanguageFunction · 0.85
entriesMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected