removeLeadingSlash

移除 URL 的开头斜杠

用法

removeLeadingSlash 函数用于移除 URL 的开头斜杠。

import { removeLeadingSlash } from '@movk/core'

removeLeadingSlash('/path/to/page') // 'path/to/page'
removeLeadingSlash('///path') // 'path'
removeLeadingSlash('path') // 'path'

API

removeLeadingSlash(url)

移除 URL 的开头斜杠。

参数

url
string required
URL 或路径字符串。

返回值

返回值
string
移除开头斜杠后的字符串。

Changelog

7c832 — refactor!: 重构模块架构,拆分 utils 为专业化模块

Copyright © 2024 - 2026 YiXuan - MIT License