def fold

bend-toon-codec@0.1.0.0 · src/fold.bend:239

import bend-toon-codec@0.1.0.0/src/fold.bend as Fold
import Base
import bend-toon-codec@0.1.0.0/src/json.bend as J

239# Fold keys of a value with at most `depth` segments per dotted key; a depth
240# below 2 folds nothing.
241def fold(+j: J.Json, +depth: U32) -> J.Json:
242  fold.if(U32.is_lt(depth, 2), j, depth)

Uses (4)

Used by (1)