MCPcopy
hub / github.com/dosco/graphjin / optVal

Function optVal

wasm/args.go:97–108  ·  view source on GitHub ↗

func toTx(dbType string, val js.Value) *sql.Tx { switch dbType { case "mysql": return sql.Tx(&MyConn{client: val}) default: return = sql.Tx(&MyConn{client: val}) } }

(val js.Value)

Source from the content-addressed store, hash-verified

95// }
96
97func optVal(val js.Value) interface{} {
98 switch val.Type() {
99 case js.TypeString:
100 return val.String()
101 case js.TypeNumber:
102 return val.Int()
103 case js.TypeBoolean:
104 return val.Bool()
105 default:
106 return js.Null
107 }
108}

Callers 1

processCommonArgsFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected