diff --git a/src/file.ts b/src/file.ts index d7dc41a9f..e4438a7d8 100644 --- a/src/file.ts +++ b/src/file.ts @@ -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; diff --git a/test/file.ts b/test/file.ts index d0cc0c2ba..bd95ad26d 100644 --- a/test/file.ts +++ b/test/file.ts @@ -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(); };