Skip to content

Commit

Permalink
fix: improve the types (#467)
Browse files Browse the repository at this point in the history
* fix: improve the types

* lol
  • Loading branch information
JustinBeckwith authored and jkwlui committed Oct 18, 2018
1 parent 1b01dd2 commit f43bd18
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 306 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"@types/mime-types": "^2.1.0",
"@types/mocha": "^5.2.3",
"@types/nock": "^9.3.0",
"@types/node-fetch": "^2.1.2",
"@types/once": "^1.4.0",
"@types/proxyquire": "^1.3.28",
"@types/pumpify": "^1.4.1",
"@types/request": "^2.47.1",
"@types/through2": "^2.0.33",
"@types/tmp": "0.0.33",
"@types/uuid": "^3.4.4",
"@types/xdg-basedir": "^2.0.0",
"codecov": "^3.0.0",
"eslint": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ export interface UploadOptions extends CreateResumableUploadOptions,
* @property {string} [userProject] The ID of the project which will be
* billed for the request.
*/
interface MakeAllFilesPublicPrivateOptions {
export interface MakeAllFilesPublicPrivateOptions {
force?: boolean;
private?: boolean;
public?: boolean;
Expand Down Expand Up @@ -3049,7 +3049,7 @@ class Bucket extends ServiceObject {

// Iterate through each file and make it public or private.
async.eachLimit<File, Error>(
files!, MAX_PARALLEL_LIMIT, processFile, (err?: Error) => {
files!, MAX_PARALLEL_LIMIT, processFile, (err?: Error|null) => {
if (err || errors.length > 0) {
callback!(err || errors, updatedFiles);
return;
Expand Down
14 changes: 6 additions & 8 deletions system-test/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import * as crypto from 'crypto';
import * as extend from 'extend';
import * as fs from 'fs';
import * as is from 'is';
import * as fetch from 'node-fetch';
import * as normalizeNewline from 'normalize-newline';
const fetch = require('node-fetch');
const normalizeNewline = require('normalize-newline');
import * as path from 'path';
import * as through from 'through2';
import * as tmp from 'tmp';
Expand Down Expand Up @@ -98,8 +98,8 @@ describe('storage', () => {
});

describe('without authentication', () => {
let privateBucket;
let privateFile;
let privateBucket: Bucket;
let privateFile: File;
let storageWithoutAuth;

let GOOGLE_APPLICATION_CREDENTIALS;
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('storage', () => {
});

describe('public data', () => {
let bucket;
let bucket: Bucket;

before(() => {
bucket = storageWithoutAuth.bucket('gcp-public-data-landsat');
Expand All @@ -145,9 +145,7 @@ describe('storage', () => {
},
(err, files) => {
assert.ifError(err);

const file = files[0];

const file = files![0];
file.download(done);
});
});
Expand Down
Loading

0 comments on commit f43bd18

Please sign in to comment.