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: change copyoptions type #2439

Merged
merged 4 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ export interface CopyOptions {
contentType?: string;
contentDisposition?: string;
destinationKmsKeyName?: string;
metadata?: FileMetadata;
metadata?: {
[key: string]: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies, realized this after I made some similar changes yesterday. We probably need to expand the types of this, similar to: https://github.com/googleapis/nodejs-storage/pull/2442/files#diff-bc9705d0f7a567399044dfc66ccc82d4d9aa1cff116842a0094d54e463c9ecbcR473

};
predefinedAcl?: string;
token?: string;
userProject?: string;
Expand Down
5 changes: 5 additions & 0 deletions test/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,17 @@ describe('File', () => {

it('should accept an options object', done => {
const newFile = new File(BUCKET, 'name');
const METADATA = {
metadataKey: 'metadataValue',
};
const options = {
option: true,
metadata: METADATA,
};

file.request = (reqOpts: DecorateRequestOptions) => {
assert.deepStrictEqual(reqOpts.json, options);
assert.strictEqual(reqOpts.json.metadata, METADATA);
done();
};

Expand Down