(typeOf reflect.Type)
| 45 | var jsVariableUnsafeChars = regexp.MustCompile(`[^A-Za-z0-9_]`) |
| 46 | |
| 47 | func 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. |
| 58 | type TypeOptions struct { |
no test coverage detected
searching dependent graphs…