Skip to content

Commit 77fd87e

Browse files
authored
feature: export DefaultTransport (googleapis#162)
Properly export DefaultTransport - some dependent libraries are using this via loading an internal file.
1 parent 62e801c commit 77fd87e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ts/lib/auth/googleauth.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ export class GoogleAuth {
9292
*/
9393
public UserRefreshClient = UserRefreshClient;
9494

95+
/**
96+
* Export DefaultTransporter as a static property of the class.
97+
*/
98+
public static DefaultTransporter = DefaultTransporter;
99+
95100
/**
96101
* Obtains the default project ID for the application..
97102
* @param {function=} callback Optional callback.

ts/test/test.index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@
1616
import * as assert from 'assert';
1717

1818
import {GoogleAuth} from '../lib/auth/googleauth';
19+
import {DefaultTransporter} from '../lib/transporters';
1920

2021
describe('module', () => {
2122
it('should export GoogleAuth as a function', () => {
2223
const cjs = require('../');
2324
assert.strictEqual(typeof cjs, 'function');
2425
assert.strictEqual(cjs, GoogleAuth);
2526
});
27+
28+
it('should publicly export DefaultTransporter', () => {
29+
const cjs = require('../');
30+
assert.strictEqual(cjs.DefaultTransporter, DefaultTransporter);
31+
});
2632
});

0 commit comments

Comments
 (0)