Require granular uuidv4. Remove process polyfill. Remove withCredentials: true in axios.

This commit is contained in:
Rikki Gibson 2018-06-05 15:34:11 -07:00
Родитель 31beb0d1eb
Коммит b1bf582203
6 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -122,8 +122,6 @@ export class AxiosHttpClient implements HttpClient {
data: axiosBody,
transformResponse: undefined,
validateStatus: () => true,
maxRedirects: 0,
withCredentials: true,
// Workaround for https://github.com/axios/axios/issues/1362
maxContentLength: 1024 * 1024 * 1024 * 10,
responseType: httpRequest.rawResponse ? (isNode ? "stream" : "blob") : "text",

Просмотреть файл

@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
import * as xml2js from "isomorphic-xml2js";
import * as uuid from "uuid";
import * as uuidv4 from "uuid/v4";
import { HttpOperationResponse } from "../httpOperationResponse";
import { RestError } from "../restError";
import { WebResource } from "../webResource";
@ -132,7 +132,7 @@ export function objectValues(obj: { [key: string]: any; }): any[] {
* @return {string} RFC4122 v4 UUID.
*/
export function generateUuid(): string {
return uuid.v4();
return uuidv4();
}
/*
@ -200,9 +200,9 @@ export function promiseToCallback(promise: Promise<any>): Function {
}
return (cb: Function): void => {
promise.then((data: any) => {
process.nextTick(cb, undefined, data);
cb(undefined, data);
}, (err: Error) => {
process.nextTick(cb, err);
cb(err);
});
};
}

Просмотреть файл

@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
// parseInt just gives NaN (falsy) for undefined/null
const port = parseInt(process.env.PORT!) || 3001;
const port = (typeof process !== "undefined" && parseInt(process.env.PORT!)) || 3001;
/**
* Base URL for the ms-rest-js testserver.

Просмотреть файл

@ -1,6 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6"
"module": "es6",
"outDir": "es"
}
}

Просмотреть файл

@ -31,7 +31,7 @@ const config: webpack.Configuration = {
tty: false,
v8: false,
Buffer: false,
process: true,
process: false,
stream: false
}
};

Просмотреть файл

@ -34,7 +34,7 @@ const config: webpack.Configuration = {
tty: false,
v8: false,
Buffer: false,
process: true,
process: false,
stream: false
}
};