MCPcopy Create free account
hub / github.com/SenseUnit/dumbproxy / mapSlice

Function mapSlice

jsext/dateutil.go:202–211  ·  view source on GitHub ↗
(s Slice, fn func(FromT) ToT)

Source from the content-addressed store, hash-verified

200}
201
202func mapSlice[Slice ~[]FromT, FromT any, ToT any](s Slice, fn func(FromT) ToT) []ToT {
203 if s == nil {
204 return nil
205 }
206 res := make([]ToT, 0, len(s))
207 for _, v := range s {
208 res = append(res, fn(v))
209 }
210 return res
211}
212
213func AddDateRange(vm *goja.Runtime) error {
214 return vm.GlobalObject().Set("dateRange", func(call goja.FunctionCall) goja.Value {

Callers 5

AddMyIPAddressExFunction · 0.85
AddSortIPAddressListFunction · 0.85
AddDNSResolveExFunction · 0.85
AddDateRangeFunction · 0.85
AddTimeRangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected