Compare commits

...

2 Commits

Author SHA1 Message Date
ca24e1d5bf v0.0.98 2023-03-29 20:25:03 +02:00
b156052e6f v0.0.97 2023-03-29 19:53:53 +02:00
2 changed files with 19 additions and 1 deletions

View File

@@ -348,3 +348,11 @@ func ArrFlattenDirect[T1 any](arr [][]T1) []T1 {
}
return r
}
func ArrCastToAny[T1 any](arr []T1) []any {
r := make([]any, len(arr))
for i, v := range arr {
r[i] = any(v)
}
return r
}

View File

@@ -1,6 +1,9 @@
package rext
import "regexp"
import (
"gogs.mikescher.com/BlackForestBytes/goext/langext"
"regexp"
)
type Regex interface {
IsMatch(haystack string) bool
@@ -156,6 +159,13 @@ func (g OptRegexMatchGroup) ValueOrEmpty() string {
return g.v.Value()
}
func (g OptRegexMatchGroup) ValueOrNil() *string {
if g.v == nil {
return nil
}
return langext.Ptr(g.v.Value())
}
func (g OptRegexMatchGroup) IsEmpty() bool {
return g.v == nil
}