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

Function AddDNSResolve

jsext/addrutil.go:107–118  ·  view source on GitHub ↗
(vm *goja.Runtime)

Source from the content-addressed store, hash-verified

105}
106
107func AddDNSResolve(vm *goja.Runtime) error {
108 return vm.GlobalObject().Set("dnsResolve", func(call goja.FunctionCall) goja.Value {
109 if len(call.Arguments) != 1 {
110 panic(vm.NewTypeError("dnsResolve expects exactly 1 argument"))
111 }
112 res := dnsResolve(call.Argument(0).String())
113 if res.IsValid() {
114 return vm.ToValue(res.String())
115 }
116 return goja.Null()
117 })
118}
119
120func AddIsResolvable(vm *goja.Runtime) error {
121 return vm.GlobalObject().Set("isResolvable", func(call goja.FunctionCall) goja.Value {

Callers

nothing calls this directly

Calls 3

dnsResolveFunction · 0.85
SetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected