def offers

bolt@1.27.0.0 · src/lsp/enc.bend:27

import bolt@1.27.0.0/src/lsp/enc.bend as Enc
import Base
import emerging-ezjson@1.2.0.0/main.bend as Ezjson
import emerging-ezjson@1.2.0.0/src/value.bend as J

27# does a list of encodings (JSON cells) offer utf-32? A cell that is not a
28# string offers nothing
29def offers(cells: J.Json) -> Bool:
30  match cells:
31    case J.JCons{h, t}:
32      +more = offers(t)
33      Bool.or(String.eq(Maybe.default(&2, String, Ezjson.as_str(h), ""), "utf-32"), more)
34    case _other:
35      False{}

Uses (7)

Used by (1)