Path to check (POSIX or Windows).
The potentially changed path (POSIX).
Creates a regular expression that matches URLs containing the given baseUrl, or a subdomain of the given baseUrl. In case there is a subdomain, the first match of the regular expression will be that subdomain.
Examples with baseUrl http://test.com/foo/
:
http://test.com/foo/
http://test.com/foo/bar/baz
http://alice.bob.test.com/foo/bar/baz
, first match result will be alice.bob
http://test.com/
http://alicetest.com/foo/
Base URL for the regular expression.
Decodes all components of a URI path.
Encodes all (non-slash) special characters in a URI path.
Makes sure the input path has exactly 1 slash at the end. Multiple slashes will get merged into one. If there is no slash it will be added.
Path to check.
The potentially changed path.
Splits a URL (or similar) string into a part containing its scheme and one containing the rest.
E.g., http://test.com/
results in { scheme: 'http://', rest: 'test.com/' }
.
String to parse.
Extracts the extension (without dot) from a path.
Custom function since path.extname
does not work on all cases (e.g. ".acl")
Input path to parse.
Checks if the identifier corresponds to a container identifier.
Identifier to check.
Checks if the path corresponds to a container path (ending in a /).
Path to check.
Adds the paths to the base path.
The base path (POSIX or Windows).
Subpaths to attach (POSIX).
The potentially changed path (POSIX).
Resolves relative segments in the path.
Path to check (POSIX or Windows).
The potentially changed path (POSIX).
Converts a URI path to the canonical version by splitting on slashes, decoding any percent-based encodings, and then encoding any special characters.
Makes sure the input path has no slashes at the end.
Path to check.
The potentially changed path.
Resolves a path to its absolute form. Absolute inputs will not be changed (except changing Windows to POSIX). Relative inputs will be interpreted relative to process.cwd().