Skip to content

Commit

Permalink
Avoid buffer deprecation warning (fixes microsoft/vscode#136874)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed Feb 4, 2022
1 parent 5f474df commit 07c22a9
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 106 deletions.
96 changes: 0 additions & 96 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@tootallnate/once": "^1.1.2",
"agent-base": "^6.0.2",
"debug": "^4.3.1",
"get-uri": "^3.0.2",
"http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0",
"socks-proxy-agent": "^5.0.0"
Expand Down
6 changes: 0 additions & 6 deletions src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import http from 'http';
import https from 'https';
import net from 'net';
import once from '@tootallnate/once';
import getUri from 'get-uri';
import createDebug from 'debug';
import { Readable } from 'stream';
import { format, parse } from 'url';
Expand Down Expand Up @@ -198,11 +197,6 @@ namespace createPacProxyAgent {
export type PacProxyAgent = _PacProxyAgent;
export const PacProxyAgent = _PacProxyAgent;

/**
* Supported "protocols". Delegates out to the `get-uri` module.
*/
export const protocols = Object.keys(getUri.protocols);

createPacProxyAgent.prototype = _PacProxyAgent.prototype;
}

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ async function readLinuxCaCertificates() {
certs: Array.from(certs),
append: false
};
} catch (err) {
if (err.code !== 'ENOENT') {
} catch (err: any) {
if (err?.code !== 'ENOENT') {
throw err;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test-client/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function testRequest<C extends typeof https | typeof http>(client:
testOptions.assertResult(result);
}
resolve();
} catch (err) {
} catch (err: any) {
err.message = `${err.message}: ${data}`;
reject(err);
}
Expand Down

0 comments on commit 07c22a9

Please sign in to comment.