WPF-like path string parser implemented in TypeScript