mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-01 03:08:17 +02:00
* create base @docusaurus/theme-common package + fix Webpack client export aliases issue shadowing other theme-common package * Move theme-classic/src/utils code to new @docusaurus/theme-common package * add prettierignore * fix bad test location for getDocusaurusAliases()
17 lines
516 B
TypeScript
17 lines
516 B
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
// Compare the 2 paths, ignoring trailing /
|
|
export const isSamePath = (
|
|
path1: string | undefined,
|
|
path2: string | undefined,
|
|
) => {
|
|
const normalize = (pathname: string | undefined) => {
|
|
return !pathname || pathname?.endsWith('/') ? pathname : `${pathname}/`;
|
|
};
|
|
return normalize(path1) === normalize(path2);
|
|
};
|