[chore]: Bump github.com/tdewolff/minify/v2 from 2.12.4 to 2.12.5 (#1649)

Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.12.4 to 2.12.5.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.12.4...v2.12.5)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2023-03-27 15:59:57 +02:00 committed by GitHub
commit 9e1756ce8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 30 additions and 28 deletions

View file

@ -18,11 +18,11 @@ var (
// Epsilon is the closest number to zero that is not considered to be zero.
var Epsilon = 0.00001
// Mediatype minifies a given mediatype by removing all whitespace.
// Mediatype minifies a given mediatype by removing all whitespace and lowercasing all parts except strings (which may be case sensitive).
func Mediatype(b []byte) []byte {
j := 0
start := 0
inString := false
start, lastString := 0, 0
for i, c := range b {
if !inString && parse.IsWhitespace(c) {
if start != 0 {
@ -33,13 +33,20 @@ func Mediatype(b []byte) []byte {
start = i + 1
} else if c == '"' {
inString = !inString
if inString {
parse.ToLower(b[lastString:i])
} else {
lastString = j + (i + 1 - start)
}
}
}
if start != 0 {
j += copy(b[j:], b[start:])
return parse.ToLower(b[:j])
parse.ToLower(b[lastString:j])
return b[:j]
}
return parse.ToLower(b)
parse.ToLower(b[lastString:])
return b
}
// DataURI minifies a data URI and calls a minifier by the specified mediatype. Specifications: https://www.ietf.org/rfc/rfc2397.txt.