Skip to content
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

fix(types): support metadata override in file.copy() #1406

Merged
merged 3 commits into from
Feb 26, 2021

Conversation

stephenplusplus
Copy link
Contributor

Fixes #1398

file.copy() allows overwriting the original file's metadata:

const originalFile = bucket.file('original-file-name')
const [copiedFile] = await originalFile.copy('new-file-name', {metadata: {thisIsACopy: 'true'}})
const [metadata] = await copiedFile.getMetadata()
// metadata.metadata.thisIsACopy === 'true'

But, we didn't document it through JSDocs or type docs. This fixes that and adds a system test.

@stephenplusplus stephenplusplus requested a review from a team February 18, 2021 15:20
@stephenplusplus stephenplusplus requested a review from a team as a code owner February 18, 2021 15:20
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Feb 18, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Feb 18, 2021
@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #1406 (8c97684) into master (65f3ee5) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1406   +/-   ##
=======================================
  Coverage   99.10%   99.10%           
=======================================
  Files          14       14           
  Lines       12143    12145    +2     
  Branches      529      602   +73     
=======================================
+ Hits        12034    12036    +2     
  Misses        109      109           
Impacted Files Coverage Δ
src/file.ts 99.94% <100.00%> (+<0.01%) ⬆️

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 65f3ee5...f1bd592. Read the comment docs.

@shaffeeullah shaffeeullah self-requested a review February 26, 2021 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow setting metadata when copying
2 participants