Sha256: 2b8ca0f3103638886fe2e592f443d87d85b65fee8133cf3f393dd3954ccec56d
Contents?: true
Size: 599 Bytes
Versions: 21
Compression:
Stored size: 599 Bytes
Contents
"use strict"; const { solelyContainsHTTPTokenCodePoints } = require("./utils.js"); module.exports = mimeType => { let serialization = `${mimeType.type}/${mimeType.subtype}`; if (mimeType.parameters.size === 0) { return serialization; } for (let [name, value] of mimeType.parameters) { serialization += ";"; serialization += name; serialization += "="; if (!solelyContainsHTTPTokenCodePoints(value) || value.length === 0) { value = value.replace(/(["\\])/g, "\\$1"); value = `"${value}"`; } serialization += value; } return serialization; };
Version data entries
21 entries across 21 versions & 2 rubygems