MCPcopy
hub / github.com/wailsapp/wails / nameTypeOf

Function nameTypeOf

v2/internal/typescriptify/typescriptify.go:47–55  ·  view source on GitHub ↗
(typeOf reflect.Type)

Source from the content-addressed store, hash-verified

45var jsVariableUnsafeChars = regexp.MustCompile(`[^A-Za-z0-9_]`)
46
47func nameTypeOf(typeOf reflect.Type) string {
48 tname := typeOf.Name()
49 gidx := strings.IndexRune(tname, '[')
50 if gidx > 0 { // its a generic type
51 rem := strings.SplitN(tname, "[", 2)
52 tname = rem[0] + "_" + jsVariableUnsafeChars.ReplaceAllLiteralString(rem[1], "_")
53 }
54 return tname
55}
56
57// TypeOptions overrides options set by `ts_*` tags.
58type TypeOptions struct {

Callers 8

AddMapFieldMethod · 0.85
convertEnumMethod · 0.85
convertTypeMethod · 0.85
AddSimpleArrayFieldMethod · 0.85
AddSimpleFieldMethod · 0.85
AddEnumFieldMethod · 0.85
AddStructFieldMethod · 0.85

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…