DecodeUtf16.valid: def of bendvy-ecs-core@0.1.0.3 Import: import bendvy-ecs-core@0.1.0.3/decode_utf16.bend as DecodeUtf16 Lines 2-7 of bendvy-ecs-core@0.1.0.3/decode_utf16.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.3/decode_utf16.bend&start_line=2&end_line=7 import Base # JS strings are UTF-16 code-unit sequences, including lone surrogates. # Bend String is Unicode-scalar text; no invalid Chr is constructed here. def valid(units:List<&2,U32>) -> Bool: match units: case []: True{} case unit <> tail: U32.is_le(unit,65535) && valid(tail) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le