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

Function AddTimeRange

jsext/dateutil.go:250–268  ·  view source on GitHub ↗
(vm *goja.Runtime)

Source from the content-addressed store, hash-verified

248}
249
250func AddTimeRange(vm *goja.Runtime) error {
251 return vm.GlobalObject().Set("timeRange", func(call goja.FunctionCall) goja.Value {
252 args := call.Arguments
253 if len(args) == 0 {
254 return vm.ToValue(false)
255 }
256 gmt := false
257 if strings.ToUpper(args[len(args)-1].String()) == "GMT" {
258 gmt = true
259 args = args[:len(args)-1]
260 }
261 return vm.ToValue(
262 timeRange(
263 gmt,
264 mapSlice(args, func(v goja.Value) int { return int(v.ToInteger()) })...,
265 ),
266 )
267 })
268}

Callers

nothing calls this directly

Calls 4

timeRangeFunction · 0.85
mapSliceFunction · 0.85
SetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected