Skip to content

扩展 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

Merged
merged 7 commits into from
Jul 31, 2020
Merged

扩展 key 的支持范围 #463

merged 7 commits into from
Jul 31, 2020

Conversation

winddies
Copy link
Contributor

@winddies winddies commented Jul 31, 2020

  • key 为 null 或者 undefined 时,参数设为 ~,则自动采用 hash 设为文件资源名,

@codecov
Copy link

codecov bot commented Jul 31, 2020

Codecov Report

Merging #463 into master will increase coverage by 0.35%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
src/api.ts 62.85% <0.00%> (ø)
src/upload/base.ts 17.14% <ø> (ø)
src/utils.ts 18.11% <100.00%> (+1.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7fa395c...5616f76. Read the comment docs.

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这边区分下 null vs 'null'

@qiniu-bot qiniu-bot added size/M and removed size/S labels Jul 31, 2020
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}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

区分 null vs ""

Copy link
Collaborator

@lzfee0227 lzfee0227 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lzfee0227 lzfee0227 merged commit 9298065 into qiniu:master Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants