Plan.path.safe: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/fetch/plan.bend as Plan Lines 183-188 of ezx@1.11.0.0/src/fetch/plan.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/fetch/plan.bend&start_line=183&end_line=188 import Base import ezx@1.11.0.0/src/pkg/pkg.bend as K import ezx@1.11.0.0/src/pkg/path.bend as Path # whether a path stays inside the tree it is laid in: written the way the # path walk writes it, so no `.` or `//` in it, not empty, not absolute and # not climbing out with `..`. A lock is not trusted with where it writes. def path.safe(+at: String) -> Bool: Bool.and(String.eq(Path.norm(at), at), Bool.not(Bool.or(K.escapes(at), String.eq(at, ".")))) Uses (8): 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=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/pkg/path.bend&name=norm https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/pkg/pkg.bend&name=escapes