def as_str
import emerging-ezjson@1.3.0.0/src/value.bend as Valueimport Base
466# a string, or none when the value is not one
467def as_str(val: Json) -> Maybe<&2, String>:
468 match val:
469 case JStr{s}:
470 Some{s}
471 case JSpan{src, +n}:
472 Some{span.str(src, n, U32.is_zero(n))}
473 case other:
474 None{}