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

Function AddIsResolvable

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

Source from the content-addressed store, hash-verified

118}
119
120func AddIsResolvable(vm *goja.Runtime) error {
121 return vm.GlobalObject().Set("isResolvable", func(call goja.FunctionCall) goja.Value {
122 if len(call.Arguments) != 1 {
123 panic(vm.NewTypeError("isResolvable expects exactly 1 argument"))
124 }
125 res := dnsResolve(call.Argument(0).String())
126 return vm.ToValue(res.IsValid())
127 })
128}
129
130func AddIsInNet(vm *goja.Runtime) error {
131 return vm.GlobalObject().Set("isInNet", 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