Skip to content

Commit

Permalink
fix: change copyoptions type (#2439)
Browse files Browse the repository at this point in the history
* fix: change copyoptions type

* fix: added test

* chore: address pr comments
  • Loading branch information
vishwarajanand committed Apr 22, 2024
1 parent 1d434a9 commit 2ebd7ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/file.ts
Expand Up @@ -361,7 +361,9 @@ export interface CopyOptions {
contentType?: string;
contentDisposition?: string;
destinationKmsKeyName?: string;
metadata?: FileMetadata;
metadata?: {
[key: string]: string | boolean | number | null;
};
predefinedAcl?: string;
token?: string;
userProject?: string;
Expand Down
5 changes: 5 additions & 0 deletions test/file.ts
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

0 comments on commit 2ebd7ac

Please sign in to comment.