用法
safeDecodeURIComponent 函数用于解码 URL 组件(安全版本,失败返回原字符串)。
import { safeDecodeURIComponent } from '@movk/core'
safeDecodeURIComponent('%E4%B8%AD%E6%96%87') // '中文'
safeDecodeURIComponent('hello%20world') // 'hello world'
safeDecodeURIComponent('%invalid%') // '%invalid%'
API
safeDecodeURIComponent(str)
解码 URL 组件(安全版本)。
参数
str
string required
要解码的字符串。
返回值
返回值
string
解码后的字符串。
Changelog
No recent changes