pub fn shell_quote(path: &Path) -> StringExpand description
A path as a shell word that stands for exactly that path.
Plain names are written as they are; names with other printable characters go in single quotes, with each single
quote written '\''; names with a control character or a byte that is not UTF-8 use the $'...' form, which shells
of the Bash family read byte for byte and which keeps a terminal escape sequence from being printed raw.
In TS you’d write (pseudocode):
function shellQuote(path: string): string;