Skip to content

Commit 5c11c85

Browse files
MasterOdindpopp07
authored andcommitted
refactor: add return type to getSdkHeaders (#936)
(cherry picked from commit cd648ac)
1 parent eea5d0a commit 5c11c85

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/common.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import os = require('os');
33
// tslint:disable-next-line:no-var-requires
44
const pkg = require('../package.json');
55

6-
export function getSdkHeaders(serviceName: string, serviceVersion: string, operationId: string): any {
6+
export type SdkHeaders = {
7+
'User-Agent': string;
8+
'X-IBMCloud-SDK-Analytics': string;
9+
}
10+
11+
export function getSdkHeaders(serviceName: string, serviceVersion: string, operationId: string): SdkHeaders | {} {
712
// disable analytics headers in the browser - they cause cors issues
813
const isBrowser = typeof window !== 'undefined';
914
if (isBrowser) {

0 commit comments

Comments
 (0)