[chore]: Bump github.com/tdewolff/minify/v2 from 2.21.3 to 2.22.3 (#3933)

Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.21.3 to 2.22.3.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.21.3...v2.22.3)

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

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]
2025-03-24 10:53:20 +00:00
committed by GitHub
parent a844f322ee
commit f7e5f31c6b
8 changed files with 69 additions and 49 deletions

4
go.mod
View File

@ -60,7 +60,7 @@ require (
github.com/spf13/cobra v1.9.1 github.com/spf13/cobra v1.9.1
github.com/spf13/viper v1.19.0 github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.10.0 github.com/stretchr/testify v1.10.0
github.com/tdewolff/minify/v2 v2.21.3 github.com/tdewolff/minify/v2 v2.22.3
github.com/technologize/otel-go-contrib v1.1.1 github.com/technologize/otel-go-contrib v1.1.1
github.com/temoto/robotstxt v1.1.2 github.com/temoto/robotstxt v1.1.2
github.com/tetratelabs/wazero v1.9.0 github.com/tetratelabs/wazero v1.9.0
@ -199,7 +199,7 @@ require (
github.com/spf13/cast v1.6.0 // indirect github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect github.com/spf13/pflag v1.0.6 // indirect
github.com/subosito/gotenv v1.6.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect
github.com/tdewolff/parse/v2 v2.7.19 // indirect github.com/tdewolff/parse/v2 v2.7.21 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
github.com/toqueteos/webbrowser v1.2.0 // indirect github.com/toqueteos/webbrowser v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect

13
go.sum generated
View File

@ -409,13 +409,12 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/tdewolff/minify/v2 v2.21.3 h1:KmhKNGrN/dGcvb2WDdB5yA49bo37s+hcD8RiF+lioV8= github.com/tdewolff/minify/v2 v2.22.3 h1:iWXbYdEwvyMXq+KoZlM7Aybp2ASq1VTibUIUxtiyfWo=
github.com/tdewolff/minify/v2 v2.21.3/go.mod h1:iGxHaGiONAnsYuo8CRyf8iPUcqRJVB/RhtEcTpqS7xw= github.com/tdewolff/minify/v2 v2.22.3/go.mod h1:K/R8TT7aivpcU8QCNUU1UdR6etfnFPr7L11TO/X7shk=
github.com/tdewolff/parse/v2 v2.7.19 h1:7Ljh26yj+gdLFEq/7q9LT4SYyKtwQX4ocNrj45UCePg= github.com/tdewolff/parse/v2 v2.7.21 h1:OCuPFtGr4mXdnfKikQlUb0n654ROJANhBqCk+wioJ/A=
github.com/tdewolff/parse/v2 v2.7.19/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= github.com/tdewolff/parse/v2 v2.7.21/go.mod h1:I7TXO37t3aSG9SlPUBefAhgIF8nt7yYUwVGgETIoBcA=
github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= github.com/tdewolff/test v1.0.11 h1:FdLbwQVHxqG16SlkGveC0JVyrJN62COWTRyUFzfbtBE=
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03u/dMQK9g+Iw9ewps4mCl1nB8Sscbo= github.com/tdewolff/test v1.0.11/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
github.com/technologize/otel-go-contrib v1.1.1 h1:wZH9aSPNWZWIkEh3vfaKfMb15AJ80jJ1aVj/4GZdqIw= github.com/technologize/otel-go-contrib v1.1.1 h1:wZH9aSPNWZWIkEh3vfaKfMb15AJ80jJ1aVj/4GZdqIw=
github.com/technologize/otel-go-contrib v1.1.1/go.mod h1:dCN/wj2WyUO8aFZFdIN+6tfJHImjTML/8r2YVYAy3So= github.com/technologize/otel-go-contrib v1.1.1/go.mod h1:dCN/wj2WyUO8aFZFdIN+6tfJHImjTML/8r2YVYAy3So=
github.com/temoto/robotstxt v1.1.2 h1:W2pOjSJ6SWvldyEuiFXNxz3xZ8aiWX5LbfDiOFd7Fxg= github.com/temoto/robotstxt v1.1.2 h1:W2pOjSJ6SWvldyEuiFXNxz3xZ8aiWX5LbfDiOFd7Fxg=

View File

@ -1,2 +1,2 @@
benchmarks/sample_* linguist-generated _benchmarks/sample_* linguist-generated
tests/*/corpus/* linguist-generated tests/*/corpus/* linguist-generated

View File

@ -1,5 +1,5 @@
# Use this image to build the executable # Use this image to build the executable
FROM golang:1.18-alpine AS build FROM golang:1.24-alpine AS build
WORKDIR /go/src/github.com/tdewolff/minify WORKDIR /go/src/github.com/tdewolff/minify
COPY . /go/src/github.com/tdewolff/minify/ COPY . /go/src/github.com/tdewolff/minify/

View File

@ -55,6 +55,11 @@ func (r *BinaryReader) Len() uint32 {
return uint32(len(r.buf)) - r.pos return uint32(len(r.buf)) - r.pos
} }
// SetLen sets the remaining length of the underlying buffer.
func (r *BinaryReader) SetLen(n uint32) {
r.buf = r.buf[: r.pos+n : r.pos+n]
}
// EOF returns true if we reached the end-of-file. // EOF returns true if we reached the end-of-file.
func (r *BinaryReader) EOF() bool { func (r *BinaryReader) EOF() bool {
return r.eof return r.eof
@ -110,6 +115,18 @@ func (r *BinaryReader) ReadUint16() uint16 {
return r.Endianness.Uint16(b) return r.Endianness.Uint16(b)
} }
// ReadUint24 reads a uint24 into a uint32.
func (r *BinaryReader) ReadUint24() uint32 {
b := r.ReadBytes(3)
if b == nil {
return 0
} else if r.Endianness == binary.LittleEndian {
return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16
} else {
return uint32(b[2]) | uint32(b[1])<<8 | uint32(b[0])<<16
}
}
// ReadUint32 reads a uint32. // ReadUint32 reads a uint32.
func (r *BinaryReader) ReadUint32() uint32 { func (r *BinaryReader) ReadUint32() uint32 {
b := r.ReadBytes(4) b := r.ReadBytes(4)
@ -128,22 +145,27 @@ func (r *BinaryReader) ReadUint64() uint64 {
return r.Endianness.Uint64(b) return r.Endianness.Uint64(b)
} }
// ReadInt8 reads a int8. // ReadInt8 reads an int8.
func (r *BinaryReader) ReadInt8() int8 { func (r *BinaryReader) ReadInt8() int8 {
return int8(r.ReadByte()) return int8(r.ReadByte())
} }
// ReadInt16 reads a int16. // ReadInt16 reads an int16.
func (r *BinaryReader) ReadInt16() int16 { func (r *BinaryReader) ReadInt16() int16 {
return int16(r.ReadUint16()) return int16(r.ReadUint16())
} }
// ReadInt32 reads a int32. // ReadInt24 reads a int24 into an int32.
func (r *BinaryReader) ReadInt24() int32 {
return int32(r.ReadUint24())
}
// ReadInt32 reads an int32.
func (r *BinaryReader) ReadInt32() int32 { func (r *BinaryReader) ReadInt32() int32 {
return int32(r.ReadUint32()) return int32(r.ReadUint32())
} }
// ReadInt64 reads a int64. // ReadInt64 reads an int64.
func (r *BinaryReader) ReadInt64() int64 { func (r *BinaryReader) ReadInt64() int64 {
return int64(r.ReadUint64()) return int64(r.ReadUint64())
} }
@ -386,8 +408,8 @@ type binaryReaderBytes struct {
data []byte data []byte
} }
func newBinaryReaderBytes(data []byte) (*binaryReaderBytes, error) { func newBinaryReaderBytes(data []byte) *binaryReaderBytes {
return &binaryReaderBytes{data}, nil return &binaryReaderBytes{data}
} }
// Close closes the reader. // Close closes the reader.
@ -414,10 +436,10 @@ type binaryReaderReader struct {
seeker bool seeker bool
} }
func newBinaryReaderReader(r io.Reader, n int64) (*binaryReaderReader, error) { func newBinaryReaderReader(r io.Reader, n int64) *binaryReaderReader {
_, readerAt := r.(io.ReaderAt) _, readerAt := r.(io.ReaderAt)
_, seeker := r.(io.Seeker) _, seeker := r.(io.Seeker)
return &binaryReaderReader{r, n, readerAt, seeker}, nil return &binaryReaderReader{r, n, readerAt, seeker}
} }
// Close closes the reader. // Close closes the reader.
@ -482,24 +504,20 @@ func NewBinaryReader2Reader(r io.Reader, n int64) (*BinaryReader2, error) {
var f IBinaryReader var f IBinaryReader
if isReaderAt || isSeeker { if isReaderAt || isSeeker {
var err error f = newBinaryReaderReader(r, n)
f, err = newBinaryReaderReader(r, n)
if err != nil {
return nil, err
}
} else { } else {
b := make([]byte, n) b := make([]byte, n)
if _, err := io.ReadFull(r, b); err != nil { if _, err := io.ReadFull(r, b); err != nil {
return nil, err return nil, err
} }
f, _ = newBinaryReaderBytes(b) f = newBinaryReaderBytes(b)
} }
return NewBinaryReader2(f), nil return NewBinaryReader2(f), nil
} }
func NewBinaryReader2Bytes(data []byte) (*BinaryReader2, error) { func NewBinaryReader2Bytes(data []byte) *BinaryReader2 {
f, _ := newBinaryReaderBytes(data) f := newBinaryReaderBytes(data)
return NewBinaryReader2(f), nil return NewBinaryReader2(f)
} }
func NewBinaryReader2File(filename string) (*BinaryReader2, error) { func NewBinaryReader2File(filename string) (*BinaryReader2, error) {
@ -641,12 +659,16 @@ func (r *BinaryReader2) ReadInt64() int64 {
// BinaryWriter is a big endian binary file format writer. // BinaryWriter is a big endian binary file format writer.
type BinaryWriter struct { type BinaryWriter struct {
buf []byte buf []byte
Endian binary.ByteOrder
} }
// NewBinaryWriter returns a big endian binary file format writer. // NewBinaryWriter returns a big endian binary file format writer.
func NewBinaryWriter(buf []byte) *BinaryWriter { func NewBinaryWriter(buf []byte) *BinaryWriter {
return &BinaryWriter{buf} return &BinaryWriter{
buf: buf,
Endian: binary.BigEndian,
}
} }
// Len returns the buffer's length in bytes. // Len returns the buffer's length in bytes.
@ -689,21 +711,21 @@ func (w *BinaryWriter) WriteUint8(v uint8) {
func (w *BinaryWriter) WriteUint16(v uint16) { func (w *BinaryWriter) WriteUint16(v uint16) {
pos := len(w.buf) pos := len(w.buf)
w.buf = append(w.buf, make([]byte, 2)...) w.buf = append(w.buf, make([]byte, 2)...)
binary.BigEndian.PutUint16(w.buf[pos:], v) w.Endian.PutUint16(w.buf[pos:], v)
} }
// WriteUint32 writes the given uint32 to the buffer. // WriteUint32 writes the given uint32 to the buffer.
func (w *BinaryWriter) WriteUint32(v uint32) { func (w *BinaryWriter) WriteUint32(v uint32) {
pos := len(w.buf) pos := len(w.buf)
w.buf = append(w.buf, make([]byte, 4)...) w.buf = append(w.buf, make([]byte, 4)...)
binary.BigEndian.PutUint32(w.buf[pos:], v) w.Endian.PutUint32(w.buf[pos:], v)
} }
// WriteUint64 writes the given uint64 to the buffer. // WriteUint64 writes the given uint64 to the buffer.
func (w *BinaryWriter) WriteUint64(v uint64) { func (w *BinaryWriter) WriteUint64(v uint64) {
pos := len(w.buf) pos := len(w.buf)
w.buf = append(w.buf, make([]byte, 8)...) w.buf = append(w.buf, make([]byte, 8)...)
binary.BigEndian.PutUint64(w.buf[pos:], v) w.Endian.PutUint64(w.buf[pos:], v)
} }
// WriteInt8 writes the given int8 to the buffer. // WriteInt8 writes the given int8 to the buffer.

View File

@ -534,7 +534,7 @@ func DecodeURL(b []byte) []byte {
c = c<<4 + int(b[j]-'a') + 10 c = c<<4 + int(b[j]-'a') + 10
} }
} }
if j == i+3 && c < 128 { if j == i+3 {
b[i] = byte(c) b[i] = byte(c)
b = append(b[:i+1], b[i+3:]...) b = append(b[:i+1], b[i+3:]...)
} }

View File

@ -8,11 +8,11 @@ import (
func ParseDecimal(b []byte) (float64, int) { func ParseDecimal(b []byte) (float64, int) {
// float64 has up to 17 significant decimal digits and an exponent in [-1022,1023] // float64 has up to 17 significant decimal digits and an exponent in [-1022,1023]
i := 0 i := 0
//sign := 1.0 sign := 1.0
//if 0 < len(b) && b[0] == '-' { if 0 < len(b) && b[0] == '-' {
// sign = -1.0 sign = -1.0
// i++ i++
//} }
start := -1 start := -1
dot := -1 dot := -1
@ -52,17 +52,16 @@ func ParseDecimal(b []byte) (float64, int) {
exp++ exp++
} }
if 1023 < exp { if 1023 < exp {
return math.Inf(1), i if sign == 1.0 {
//if sign == 1.0 { return math.Inf(1), i
// return math.Inf(1), i } else {
//} else { return math.Inf(-1), i
// return math.Inf(-1), i }
//}
} else if exp < -1022 { } else if exp < -1022 {
return 0.0, i return 0.0, i
} }
f := float64(n) // sign * float64(n) f := sign * float64(n)
if 0 <= exp && exp < 23 { if 0 <= exp && exp < 23 {
return f * float64pow10[exp], i return f * float64pow10[exp], i
} else if 23 < exp && exp < 0 { } else if 23 < exp && exp < 0 {

6
vendor/modules.txt vendored
View File

@ -822,11 +822,11 @@ github.com/stretchr/testify/suite
# github.com/subosito/gotenv v1.6.0 # github.com/subosito/gotenv v1.6.0
## explicit; go 1.18 ## explicit; go 1.18
github.com/subosito/gotenv github.com/subosito/gotenv
# github.com/tdewolff/minify/v2 v2.21.3 # github.com/tdewolff/minify/v2 v2.22.3
## explicit; go 1.18 ## explicit; go 1.23.0
github.com/tdewolff/minify/v2 github.com/tdewolff/minify/v2
github.com/tdewolff/minify/v2/html github.com/tdewolff/minify/v2/html
# github.com/tdewolff/parse/v2 v2.7.19 # github.com/tdewolff/parse/v2 v2.7.21
## explicit; go 1.13 ## explicit; go 1.13
github.com/tdewolff/parse/v2 github.com/tdewolff/parse/v2
github.com/tdewolff/parse/v2/buffer github.com/tdewolff/parse/v2/buffer