ConstNormalizes an import path meant for use in an import statement in JavaScript. When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory.
If the path starts with ./, it is preserved (unlike what would happen with path.posix.normalize() normally).
Helpful for custom linter rules that need to check (or fix) import paths.
The import path to normalize.
The import path normalized.
Normalises an import path meant for use in an import statement in JavaScript. When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory.
If the path starts with ./, it is preserved (unlike what would happen with path.posix.normalize() normally).
Helpful for custom linter rules that need to check (or fix) import paths.