-
Notifications
You must be signed in to change notification settings - Fork 516
扩展 key 的支持范围 #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
扩展 key 的支持范围 #463
Conversation
Codecov Report
@@ Coverage Diff @@
## master #463 +/- ##
==========================================
+ Coverage 39.64% 40.00% +0.35%
==========================================
Files 7 7
Lines 454 455 +1
Branches 95 98 +3
==========================================
+ Hits 180 182 +2
+ Misses 272 271 -1
Partials 2 2
Continue to review full report at Codecov.
|
src/utils.ts
Outdated
@@ -53,7 +53,7 @@ export function setLocalFileInfo(localKey: string, info: LocalInfo) { | |||
} | |||
} | |||
|
|||
export function createLocalKey(name: string, key: string, size: number): string { | |||
export function createLocalKey(name: string, key: string | null, size: number): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这边区分下 null
vs 'null'
吧
src/utils.ts
Outdated
export function createLocalKey(name: string, key: string | null, size: number): string { | ||
return `qiniu_js_sdk_upload_file_name_${name}_key_${key}_size_${size}` | ||
export function createLocalKey(name: string, key: string | null | undefined, size: number): string { | ||
return `qiniu_js_sdk_upload_file_name_${name}_key_${key == null ? '' : key}_size_${size}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
区分 null
vs ""
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
null
或者undefined
时,参数设为~
,则自动采用 hash 设为文件资源名,