Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

fix: don't modify passed in options#1895

Merged
shaffeeullah merged 5 commits intomainfrom
shaffeeullah/deepCopy
Apr 28, 2022
Merged

fix: don't modify passed in options#1895
shaffeeullah merged 5 commits intomainfrom
shaffeeullah/deepCopy

Conversation

@shaffeeullah
Copy link
Contributor

Fixes #1891

@shaffeeullah shaffeeullah requested a review from a team as a code owner April 28, 2022 16:27
@shaffeeullah shaffeeullah requested a review from a team April 28, 2022 16:27
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the googleapis/nodejs-storage API. labels Apr 28, 2022
@shaffeeullah shaffeeullah added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 28, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 28, 2022
@shaffeeullah shaffeeullah merged commit cd80ca3 into main Apr 28, 2022
@shaffeeullah shaffeeullah deleted the shaffeeullah/deepCopy branch April 28, 2022 17:28
writable.write('data');
});

it('should not overwrite passed in options', done => {

Choose a reason for hiding this comment

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

It would also be good to have the following:

    it('should not overwrite passed in options', done => {
      const metadataObject = {metadata: {}};
      const writable = file.createWriteStream(emptyObject);
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      file.startResumableUpload_ = (stream: {}, options: any) => {
        assert.strictEqual(options.metadata.contentType, 'image/png');
        assert.deepStrictEqual(metadataObject, {metadata: {}});
        done();
      };

      writable.write('data');
    });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: storage Issues related to the googleapis/nodejs-storage API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UploadOptions mutates provided object

4 participants