MCPcopy Index your code
hub / github.com/nodejs/node / sniffMimeType

Function sniffMimeType

lib/internal/inspector/network.js:54–71  ·  view source on GitHub ↗
(contentType)

Source from the content-addressed store, hash-verified

52};
53
54function sniffMimeType(contentType) {
55 let mimeType;
56 let charset;
57 try {
58 const mimeTypeObj = new MIMEType(contentType);
59 mimeType = StringPrototypeToLowerCase(mimeTypeObj.essence || '');
60 charset = StringPrototypeToLowerCase(mimeTypeObj.params.get('charset') || '');
61 } catch {
62 mimeType = '';
63 charset = '';
64 }
65
66 return {
67 __proto__: null,
68 mimeType,
69 charset,
70 };
71}
72
73function registerDiagnosticChannels(listenerPairs) {
74 function enable() {

Callers 4

convertHeaderObjectFunction · 0.85
convertHeaderObjectFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…