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:
Joshua Chen 2022-08-01 15:23:01 +08:00 committed by GitHub
parent 3a0e90eacd
commit 40827c6c72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 5 deletions

View file

@ -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 === '') {