Skip to content

Commit

Permalink
fix: tsec hygiene check
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 committed Apr 9, 2021
1 parent 688f820 commit bcf2d68
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@types/minimist": "^1.2.1",
"@types/mkdirp": "^1.0.1",
"@types/mocha": "^8.2.0",
"@types/node": "^12.19.9",
"@types/node": "^14.14.37",
"@types/p-limit": "^2.2.0",
"@types/plist": "^3.0.2",
"@types/pump": "^1.0.1",
Expand Down
10 changes: 5 additions & 5 deletions build/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -371,16 +371,16 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb"
integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ==

"@types/node@^12.19.9":
version "12.19.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.9.tgz#990ad687ad8b26ef6dcc34a4f69c33d40c95b679"
integrity sha512-yj0DOaQeUrk3nJ0bd3Y5PeDRJ6W0r+kilosLA+dzF3dola/o9hxhMSg2sFvVcA2UHS5JSOsZp4S0c1OEXc4m1Q==

"@types/node@^14.14.21":
version "14.14.22"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18"
integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==

"@types/node@^14.14.37":
version "14.14.37"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e"
integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==

"@types/p-limit@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@types/p-limit/-/p-limit-2.2.0.tgz#94a608e9b258a6c6156a13d1a14fd720dba70b97"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"@types/keytar": "^4.4.0",
"@types/minimist": "^1.2.1",
"@types/mocha": "^8.2.0",
"@types/node": "^12.19.9",
"@types/node": "^14.14.37",
"@types/sinon": "^1.16.36",
"@types/trusted-types": "^1.0.6",
"@types/vscode-windows-registry": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/node/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class LineDecoder {
private stringDecoder: sd.StringDecoder;
private remaining: string | null;

constructor(encoding: string = 'utf8') {
constructor(encoding: BufferEncoding = 'utf8') {
this.stringDecoder = new sd.StringDecoder(encoding);
this.remaining = null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/node/id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const virtualMachineHint: { value(): number } = new class {
const interfaces = networkInterfaces();
for (let name in interfaces) {
if (Object.prototype.hasOwnProperty.call(interfaces, name)) {
for (const { mac, internal } of interfaces[name]) {
for (const { mac, internal } of interfaces[name]!) {
if (!internal) {
interfaceCount += 1;
if (this._isVirtualMachineMacAdress(mac.toUpperCase())) {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/node/macAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function doGetMac(): Promise<string> {
try {
const ifaces = networkInterfaces();
for (const [, infos] of Object.entries(ifaces)) {
for (const info of infos) {
for (const info of infos!) {
if (validateMacAddress(info.mac)) {
return resolve(info.mac);
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/code/electron-main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class CodeMain {
private initServices(environmentMainService: IEnvironmentMainService, configurationService: ConfigurationService, stateService: StateService): Promise<unknown> {

// Environment service (paths)
const environmentServiceInitialization = Promise.all<void | undefined>([
const environmentServiceInitialization = Promise.all<string | undefined>([
environmentMainService.extensionsPath,
environmentMainService.nodeCachedDataDir,
environmentMainService.logsPath,
Expand Down
8 changes: 4 additions & 4 deletions src/vs/workbench/services/search/node/fileSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export class FileWalker {
/**
* Public for testing.
*/
readStdout(cmd: childProcess.ChildProcess, encoding: string, cb: (err: Error | null, stdout?: string) => void): void {
readStdout(cmd: childProcess.ChildProcess, encoding: BufferEncoding, cb: (err: Error | null, stdout?: string) => void): void {
let all = '';
this.collectStdout(cmd, encoding, () => { }, (err: Error | null, stdout?: string, last?: boolean) => {
if (err) {
Expand All @@ -310,7 +310,7 @@ export class FileWalker {
});
}

private collectStdout(cmd: childProcess.ChildProcess, encoding: string, onMessage: (message: IProgressMessage) => void, cb: (err: Error | null, stdout?: string, last?: boolean) => void): void {
private collectStdout(cmd: childProcess.ChildProcess, encoding: BufferEncoding, onMessage: (message: IProgressMessage) => void, cb: (err: Error | null, stdout?: string, last?: boolean) => void): void {
let onData = (err: Error | null, stdout?: string, last?: boolean) => {
if (err || last) {
onData = () => { };
Expand Down Expand Up @@ -357,7 +357,7 @@ export class FileWalker {
});
}

private forwardData(stream: Readable, encoding: string, cb: (err: Error | null, stdout?: string) => void): StringDecoder {
private forwardData(stream: Readable, encoding: BufferEncoding, cb: (err: Error | null, stdout?: string) => void): StringDecoder {
const decoder = new StringDecoder(encoding);
stream.on('data', (data: Buffer) => {
cb(null, decoder.write(data));
Expand All @@ -373,7 +373,7 @@ export class FileWalker {
return buffers;
}

private decodeData(buffers: Buffer[], encoding: string): string {
private decodeData(buffers: Buffer[], encoding: BufferEncoding): string {
const decoder = new StringDecoder(encoding);
return buffers.map(buffer => decoder.write(buffer)).join('');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ flakySuite('Files - NativeTextFileService i/o', function () {
let testDir: string;

function readFile(path: string): Promise<Buffer>;
function readFile(path: string, encoding: string): Promise<string>;
function readFile(path: string, encoding?: string): Promise<Buffer | string> {
function readFile(path: string, encoding: BufferEncoding): Promise<string>;
function readFile(path: string, encoding?: BufferEncoding): Promise<Buffer | string> {
return promises.readFile(path, encoding);
}

Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,7 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==

"@types/node@^12.19.9":
version "12.19.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.9.tgz#990ad687ad8b26ef6dcc34a4f69c33d40c95b679"
integrity sha512-yj0DOaQeUrk3nJ0bd3Y5PeDRJ6W0r+kilosLA+dzF3dola/o9hxhMSg2sFvVcA2UHS5JSOsZp4S0c1OEXc4m1Q==

"@types/node@^14.6.2":
"@types/node@^14.14.37", "@types/node@^14.6.2":
version "14.14.37"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e"
integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==
Expand Down

0 comments on commit bcf2d68

Please sign in to comment.