/**
 * 字符串`末尾`添加`/`
 */
export function addTrailingSlash(path: string) {
  return path.endsWith("/") ? path : path + "/";
}

/**
 * 删除特定`开头`的`字符串`
 */
export function removeHeadingString(path: string, heading: string) {
  return path.startsWith(heading) ? path.slice(heading.length) : path;
}

/**
 * 删除字符串`开头`的`/`
 */
export function removeHeadingSlash(path: string) {
  return removeHeadingString(path, "/");
}
