whatwg-mimetype
Advanced tools
Comparing version 2.2.0 to 2.3.0
"use strict"; | ||
const { | ||
removeLeadingAndTrailingASCIIWhitespace, | ||
removeTrailingASCIIWhitespace, | ||
isASCIIWhitespaceChar, | ||
removeLeadingAndTrailingHTTPWhitespace, | ||
removeTrailingHTTPWhitespace, | ||
isHTTPWhitespaceChar, | ||
solelyContainsHTTPTokenCodePoints, | ||
@@ -12,3 +12,3 @@ soleyContainsHTTPQuotedStringTokenCodePoints, | ||
module.exports = input => { | ||
input = removeLeadingAndTrailingASCIIWhitespace(input); | ||
input = removeLeadingAndTrailingHTTPWhitespace(input); | ||
@@ -39,3 +39,3 @@ let position = 0; | ||
subtype = removeTrailingASCIIWhitespace(subtype); | ||
subtype = removeTrailingHTTPWhitespace(subtype); | ||
@@ -56,3 +56,3 @@ if (subtype.length === 0 || !solelyContainsHTTPTokenCodePoints(subtype)) { | ||
while (isASCIIWhitespaceChar(input[position])) { | ||
while (isHTTPWhitespaceChar(input[position])) { | ||
++position; | ||
@@ -111,3 +111,3 @@ } | ||
parameterValue = removeTrailingASCIIWhitespace(parameterValue); | ||
parameterValue = removeTrailingHTTPWhitespace(parameterValue); | ||
@@ -114,0 +114,0 @@ if (parameterValue === "") { |
"use strict"; | ||
exports.removeLeadingAndTrailingASCIIWhitespace = string => { | ||
return string.replace(/^[ \t\n\f\r]+/, "").replace(/[ \t\n\f\r]+$/, ""); | ||
exports.removeLeadingAndTrailingHTTPWhitespace = string => { | ||
return string.replace(/^[ \t\n\r]+/, "").replace(/[ \t\n\r]+$/, ""); | ||
}; | ||
exports.removeTrailingASCIIWhitespace = string => { | ||
return string.replace(/[ \t\n\f\r]+$/, ""); | ||
exports.removeTrailingHTTPWhitespace = string => { | ||
return string.replace(/[ \t\n\r]+$/, ""); | ||
}; | ||
exports.isASCIIWhitespaceChar = char => { | ||
return char === " " || char === "\t" || char === "\n" || char === "\f" || char === "\r"; | ||
exports.isHTTPWhitespaceChar = char => { | ||
return char === " " || char === "\t" || char === "\n" || char === "\r"; | ||
}; | ||
@@ -14,0 +14,0 @@ |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)", | ||
@@ -27,7 +27,7 @@ "license": "MIT", | ||
"devDependencies": { | ||
"eslint": "^5.5.0", | ||
"eslint": "^5.9.0", | ||
"jest": "^23.6.0", | ||
"printable-string": "^0.3.0", | ||
"request": "^2.88.0", | ||
"whatwg-encoding": "^1.0.4" | ||
"whatwg-encoding": "^1.0.5" | ||
}, | ||
@@ -34,0 +34,0 @@ "jest": { |
@@ -27,3 +27,3 @@ # Parse, serialize, and manipulate MIME types | ||
This package's algorithms conform to those of the WHATWG [MIME Sniffing Standard](https://mimesniff.spec.whatwg.org/), and is aligned up to commit [190c18a](https://github.com/whatwg/mimesniff/commit/190c18af1d81754ff298cfb6fc9e581afdce4d2c). | ||
This package's algorithms conform to those of the WHATWG [MIME Sniffing Standard](https://mimesniff.spec.whatwg.org/), and is aligned up to commit [126286a](https://github.com/whatwg/mimesniff/commit/126286ab2dcf3e2d541349ed93539a88bf394ad5). | ||
@@ -30,0 +30,0 @@ ## `MIMEType` API |
16182