用法
removeTrailingSlash 函数用于移除 URL 的尾部斜杠。
import { removeTrailingSlash } from '@movk/core'
removeTrailingSlash('https://example.com/') // 'https://example.com'
removeTrailingSlash('https://example.com/path/') // 'https://example.com/path'
removeTrailingSlash('https://example.com') // 'https://example.com'
API
removeTrailingSlash(url)
移除 URL 的尾部斜杠。
参数
url
string required
URL 字符串。
返回值
返回值
string
移除尾部斜杠后的 URL。
Changelog
No recent changes