mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-23 19:48:54 +02:00
fix(utils): always match exclusion root dirs as complete folder paths (#7864)
* fix(utils): always match exclusion root dirs as complete folder paths * fix * fix? * fix for real
This commit is contained in:
parent
3a0e90eacd
commit
40827c6c72
5 changed files with 35 additions and 5 deletions
|
@ -5,6 +5,16 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** Adds a given string prefix to `str`. */
|
||||
export function addPrefix(str: string, prefix: string): string {
|
||||
return str.startsWith(prefix) ? str : `${prefix}${str}`;
|
||||
}
|
||||
|
||||
/** Adds a given string suffix to `str`. */
|
||||
export function addSuffix(str: string, suffix: string): string {
|
||||
return str.endsWith(suffix) ? str : `${str}${suffix}`;
|
||||
}
|
||||
|
||||
/** Removes a given string suffix from `str`. */
|
||||
export function removeSuffix(str: string, suffix: string): string {
|
||||
if (suffix === '') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue