MCPcopy
hub / github.com/wavetermdev/waveterm / isFieldOmitEmpty

Function isFieldOmitEmpty

pkg/tsgen/tsgen.go:112–125  ·  view source on GitHub ↗
(field reflect.StructField)

Source from the content-addressed store, hash-verified

110}
111
112func isFieldOmitEmpty(field reflect.StructField) bool {
113 jsonTag := field.Tag.Get("json")
114 if jsonTag != "" {
115 parts := strings.Split(jsonTag, ",")
116 if len(parts) > 1 {
117 for _, part := range parts[1:] {
118 if part == "omitempty" {
119 return true
120 }
121 }
122 }
123 }
124 return false
125}
126
127func TypeToTSType(t reflect.Type, tsTypesMap map[reflect.Type]string) (string, []reflect.Type) {
128 switch t.Kind() {

Callers 1

generateTSTypeInternalFunction · 0.85

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected