Skip to content

Commit

Permalink
Resolved review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
muthurathinam-m committed Jan 28, 2019
1 parent 8ee9df3 commit 93342d2
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 34 deletions.
2 changes: 1 addition & 1 deletion lib/graph-js-sdk-core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/graph-js-sdk-web.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/src/Client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export declare class Client {
* @public
* @static
* To create a client instance with the Client Options
* @param {ClientOptions} options - The options object for initializing the client
* @param {ClientOptions} clientOptions - The options object for initializing the client
* @returns The Client instance
*/
static initWithMiddleware(options: ClientOptions): Client;
static initWithMiddleware(clientOptions: ClientOptions): Client;
/**
* @public
* Entry point to make requests
Expand Down
6 changes: 3 additions & 3 deletions lib/src/Client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/src/Client.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/src/GraphError.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ export declare class GraphError {
* @public
* A member holding code i.e name of the error
*/
code: string;
code: string | null;
/**
* @public
* A member holding error message
*/
message: string;
message: string | null;
/**
* @public
* A member holding request-id i.e identifier of the request
*/
requestId: string;
requestId: string | null;
/**
* @public
* A member holding processed date and time of the request
Expand Down
20 changes: 12 additions & 8 deletions lib/src/GraphRequest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/src/GraphRequest.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ export class Client {
* @public
* @static
* To create a client instance with the Client Options
* @param {ClientOptions} options - The options object for initializing the client
* @param {ClientOptions} clientOptions - The options object for initializing the client
* @returns The Client instance
*/
public static initWithMiddleware(options: ClientOptions): Client {
public static initWithMiddleware(clientOptions: ClientOptions): Client {
try {
return new Client(options);
return new Client(clientOptions);
} catch (error) {
throw error;
}
Expand Down
6 changes: 3 additions & 3 deletions src/GraphError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ export class GraphError {
* @public
* A member holding code i.e name of the error
*/
public code: string;
public code: string | null;

/**
* @public
* A member holding error message
*/
public message: string;
public message: string | null;

/**
* @public
* A member holding request-id i.e identifier of the request
*/
public requestId: string;
public requestId: string | null;

/**
* @public
Expand Down
20 changes: 12 additions & 8 deletions src/GraphRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,21 @@ export class GraphRequest {

// Find where the host ends
let endOfHostStrPos = path.indexOf("/");
// Parse out the host
self.urlComponents.host = "https://" + path.substring(0, endOfHostStrPos);
// Strip the host from path
path = path.substring(endOfHostStrPos + 1, path.length);
if(endOfHostStrPos !== -1) {
// Parse out the host
self.urlComponents.host = "https://" + path.substring(0, endOfHostStrPos);
// Strip the host from path
path = path.substring(endOfHostStrPos + 1, path.length);
}

// Remove the following version
let endOfVersionStrPos = path.indexOf("/");
// Parse out the version
self.urlComponents.version = path.substring(0, endOfVersionStrPos);
// Strip version from path
path = path.substring(endOfVersionStrPos + 1, path.length);
if(endOfVersionStrPos !== -1) {
// Parse out the version
self.urlComponents.version = path.substring(0, endOfVersionStrPos);
// Strip version from path
path = path.substring(endOfVersionStrPos + 1, path.length);
}
}

// Strip out any leading "/"
Expand Down

0 comments on commit 93342d2

Please sign in to comment.