def props.head.value

gralha-svg-render@0.1.0.1 · svg.bend:1996

import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
import gralha-xml-doc@0.1.0.1/xml.bend as XML

1996# The parent's value for key: the head when the parent list is resolved, else by name.
1997def props.head.value(parent: List<&2, XML.Attr>, +key: String, +initial: String) -> String:
1998  match parent:
1999    case Nil{}: initial
2000    case Con{XML.Attr{k, v}, t}:
2001      +kk = k
2002      +vv = v
2003      props.head.pick(U.string.equal(kk, key), vv, Con{XML.Attr{kk, vv}, t}, key, initial)

Uses (5)

Used by (1)