mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
ESLintify Part 1 (#837)
* ESLint-ify * Allow empty try/catch * Escape regexp
This commit is contained in:
parent
128dbfca0a
commit
e8e3f42685
44 changed files with 466 additions and 555 deletions
|
@ -26,12 +26,11 @@ function removeExtension(path) {
|
|||
|
||||
function getPath(path, cleanUrl = false) {
|
||||
if (cleanUrl) {
|
||||
if (path.endsWith('/index.html')) {
|
||||
return path.replace(/\/index.html$/, '');
|
||||
} else {
|
||||
return removeExtension(path);
|
||||
}
|
||||
return path.endsWith('/index.html')
|
||||
? path.replace(/\/index.html$/, '')
|
||||
: removeExtension(path);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue