buildCosObjectKey
拼接腾讯云 COS 对象键:逻辑 bucket 前缀 + 对象 path。
函数签名
typescript
function buildCosObjectKey(bucketPrefix: string, objectPath: string): string参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
bucketPrefix | string | 是 | 业务逻辑 bucket 名(作 key 前缀) |
objectPath | string | 是 | 对象相对路径 |
返回值
| 类型 | 说明 |
|---|---|
string | {prefix}/{path},去除首尾多余 / |
工作原理
bucketPrefix去掉首尾/。objectPath去掉首部/。- 以
/拼接。