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

Function AddDNSDomainLevels

jsext/hostutil.go:52–61  ·  view source on GitHub ↗
(vm *goja.Runtime)

Source from the content-addressed store, hash-verified

50}
51
52func AddDNSDomainLevels(vm *goja.Runtime) error {
53 return vm.GlobalObject().Set("dnsDomainLevels", func(call goja.FunctionCall) goja.Value {
54 if len(call.Arguments) < 1 {
55 return vm.ToValue(0)
56 }
57 name := call.Argument(0).String()
58 name, _ = strings.CutSuffix(name, ".")
59 return vm.ToValue(strings.Count(name, "."))
60 })
61}

Callers

nothing calls this directly

Calls 2

SetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected