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

Function AddDNSResolveEx

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

Source from the content-addressed store, hash-verified

231}
232
233func AddDNSResolveEx(vm *goja.Runtime) error {
234 return vm.GlobalObject().Set("dnsResolveEx", func(call goja.FunctionCall) goja.Value {
235 if len(call.Arguments) != 1 {
236 panic(vm.NewTypeError("dnsResolveEx expects exactly 1 argument"))
237 }
238 res := mapSlice(dnsResolveEx(call.Argument(0).String()), func(a netip.Addr) string { return a.String() })
239 return vm.ToValue(strings.Join(res, ";"))
240 })
241}
242
243func AddIsResolvableEx(vm *goja.Runtime) error {
244 return vm.GlobalObject().Set("isResolvableEx", func(call goja.FunctionCall) goja.Value {

Callers

nothing calls this directly

Calls 4

mapSliceFunction · 0.85
dnsResolveExFunction · 0.85
SetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected