| 1 | // ⚡️ Fiber is an Express inspired web framework written in Go with ☕️ |
| 2 | // 🤖 Github Repository: https://github.com/gofiber/fiber |
| 3 | // 📌 API Documentation: https://docs.gofiber.io |
| 4 | |
| 5 | package utils |
| 6 | |
| 7 | import ( |
| 8 | casebytes "github.com/gofiber/utils/v2/bytes" |
| 9 | ) |
| 10 | |
| 11 | // ToLowerBytes converts an ASCII byte slice to lower-case in-place. |
| 12 | // |
| 13 | // Deprecated: use [github.com/gofiber/utils/v2/bytes.UnsafeToLower] instead. |
| 14 | // This wrapper keeps backward compatibility by mutating the provided slice. |
| 15 | // |
| 16 | //go:fix inline |
| 17 | func ToLowerBytes(b []byte) []byte { |
| 18 | return casebytes.UnsafeToLower(b) |
| 19 | } |
| 20 | |
| 21 | // ToUpperBytes converts an ASCII byte slice to upper-case in-place. |
| 22 | // |
| 23 | // Deprecated: use [github.com/gofiber/utils/v2/bytes.UnsafeToUpper] instead. |
| 24 | // This wrapper keeps backward compatibility by mutating the provided slice. |
| 25 | // |
| 26 | //go:fix inline |
| 27 | func ToUpperBytes(b []byte) []byte { |
| 28 | return casebytes.UnsafeToUpper(b) |
| 29 | } |
| 30 | |
| 31 | // AddTrailingSlashBytes appends a trailing '/' to b if it does not already end with one. |
| 32 | // If the input already ends with '/', the original slice is returned. |
| 33 | // A new slice is returned when a '/' is appended. The original slice is never modified. |
| 34 | func AddTrailingSlashBytes(b []byte) []byte { |
| 35 | return UnsafeBytes(AddTrailingSlashString(UnsafeString(b))) |
| 36 | } |