path-normalize is different from
normalize-path only handles
slashes, while this lib is a browser-focused version of the POSIX
path-normalize also differs from Node's
handles uri-encoded strings and strips directory traversals (
Portions of this code are heavily based on code in Node.
npm i path-normalize
const normalize =const normal =
Slightly more real-world example:
// imaginary client-side router apirouter
See also: react-router-path-normalize.