MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / P

Function P

pkg/vdom/vdom.go:283–299  ·  view source on GitHub ↗
(propName string, propVal any)

Source from the content-addressed store, hash-verified

281}
282
283func P(propName string, propVal any) any {
284 if propVal == nil {
285 return map[string]any{propName: nil}
286 }
287 if propName == "style" {
288 strVal, ok := propVal.(string)
289 if ok {
290 styleMap, err := styleAttrStrToStyleMap(strVal, nil)
291 if err == nil {
292 return styleAttrMapWrapper{StyleAttrMap: styleMap}
293 }
294 log.Printf("Error parsing style attribute: %v\n", err)
295 return nil
296 }
297 }
298 return map[string]any{propName: propVal}
299}
300
301func getHookFromCtx(ctx context.Context) (*VDomContextVal, *Hook) {
302 vc := getRenderContext(ctx)

Callers

nothing calls this directly

Calls 1

styleAttrStrToStyleMapFunction · 0.85

Tested by

no test coverage detected