1/** @Utils.Uri.Helper — file and resource URI conversion */2modulePuduLangMcp.Utils.Uri34/// The prefix of every file URI.5constFILE_SCHEME: Str = "file://"67/// The `file://` URI of an absolute path.8exportfnfileUri(path: Str) -> Str {9FILE_SCHEME + path.replace("%", "%25").replace(" ", "%20").replace("#", "%23").replace("?", "%3F")10}1112/// The path a `file://` URI names, or `None` for any other scheme.13exportfnpathOfFileUri(uri: Str) -> Option[Str] {14if !uri.startsWith(FILE_SCHEME) { returnNone }15Some(uri.drop(FILE_SCHEME.length()).replace("%20", " ").replace("%23", "#").replace("%3F", "?").replace("%25", "%"))16}1718/// The part of a URI after `scheme`, or `None` when it has another scheme.19exportfnresourcePath(uri: Str, scheme: Str) -> Option[Str] {20if uri.startsWith(scheme) { Some(uri.drop(scheme.length())) } else { None }21}22