Skip to content

Commit

Permalink
fix: remove extraneous mime-types package in favor of mime
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelgrosso1 committed Apr 4, 2024
1 parent 36d2721 commit 00df71a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
"gaxios": "^6.0.2",
"google-auth-library": "^9.6.3",
"mime": "^3.0.0",
"mime-types": "^2.0.8",
"p-limit": "^3.0.1",
"retry-request": "^7.0.0",
"teeny-request": "^9.0.0",
Expand All @@ -100,7 +99,6 @@
"@types/compressible": "^2.0.0",
"@types/ent": "^2.2.1",
"@types/mime": "^3.0.0",
"@types/mime-types": "^2.1.0",
"@types/mocha": "^9.1.1",
"@types/mockery": "^1.4.29",
"@types/node": "^20.4.4",
Expand Down
4 changes: 2 additions & 2 deletions src/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {paginator} from '@google-cloud/paginator';
import {promisifyAll} from '@google-cloud/promisify';
import * as fs from 'fs';
import * as http from 'http';
import * as mime from 'mime-types';
import mime from 'mime';
import * as path from 'path';
import pLimit from 'p-limit';
import {promisify} from 'util';
Expand Down Expand Up @@ -1625,7 +1625,7 @@ class Bucket extends ServiceObject<Bucket, BucketMetadata> {
callback = callback || util.noop;

if (!destinationFile.metadata.contentType) {
const destinationContentType = mime.contentType(destinationFile.name);
const destinationContentType = mime.getType(destinationFile.name);

if (destinationContentType) {
destinationFile.metadata.contentType = destinationContentType;
Expand Down
8 changes: 4 additions & 4 deletions test/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import assert from 'assert';
import * as fs from 'fs';
import {describe, it, before, beforeEach, after, afterEach} from 'mocha';
import * as mime from 'mime-types';
import mime from 'mime';
import pLimit from 'p-limit';
import * as path from 'path';
import proxyquire from 'proxyquire';
Expand Down Expand Up @@ -704,7 +704,7 @@ describe('Bucket', () => {
destination.request = (reqOpts: DecorateRequestOptions) => {
assert.strictEqual(
reqOpts.json.destination.contentType,
mime.contentType(destination.name)
mime.getType(destination.name)
);

done();
Expand Down Expand Up @@ -735,7 +735,7 @@ describe('Bucket', () => {
destination.request = (reqOpts: DecorateRequestOptions) => {
assert.strictEqual(
reqOpts.json.destination.contentType,
mime.contentType(destination.name)
mime.getType(destination.name)
);

done();
Expand All @@ -751,7 +751,7 @@ describe('Bucket', () => {
destination.request = (reqOpts: DecorateRequestOptions) => {
assert.strictEqual(reqOpts.uri, '/compose');
assert.deepStrictEqual(reqOpts.json, {
destination: {contentType: mime.contentType(destination.name)},
destination: {contentType: mime.getType(destination.name)},
sourceObjects: [{name: sources[0].name}, {name: sources[1].name}],
});

Expand Down

0 comments on commit 00df71a

Please sign in to comment.