Skip to content

Commit 70d84b7

Browse files
committed
chore: Update npm modules
1 parent 6b95d5c commit 70d84b7

7 files changed

+151
-153
lines changed

package-lock.json

+131-128
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+10-11
Original file line numberDiff line numberDiff line change
@@ -666,24 +666,23 @@
666666
"lint": "tslint --project tsconfig.json -e src/*.d.ts -t verbose"
667667
},
668668
"devDependencies": {
669-
"@types/fs-extra": "5.0.0",
670-
"@types/highlight.js": "^9.12.3",
671-
"@types/lodash": "^4.14.123",
669+
"@types/fs-extra": "^9.0.11",
670+
"@types/lodash": "^4.14.170",
672671
"@types/markdown-it": "0.0.7",
673672
"@types/mocha": "^2.2.42",
674-
"@types/node": "^7.0.43",
675-
"@types/vscode": "1.42.0",
673+
"@types/node": "^14.14.33",
676674
"@types/require-from-string": "^1.2.0",
677-
"tslint": "^5.9.1",
678-
"typescript": "^2.6.1"
675+
"@types/vscode": "1.42.0",
676+
"tslint": "^5.20.1",
677+
"typescript": "^4.3.2"
679678
},
680679
"dependencies": {
681-
"fs-extra": "^6.0.1",
682-
"highlight.js": "^9.15.6",
683-
"lodash": "^4.17.19",
680+
"fs-extra": "^10.0.0",
681+
"highlight.js": "^10.7.2",
682+
"lodash": "^4.17.21",
684683
"markdown-it": "^8.4.2",
685684
"require-from-string": "^2.0.2",
686-
"unescape-js": "^1.1.1",
685+
"unescape-js": "^1.1.4",
687686
"vsc-leetcode-cli": "2.7.0"
688687
}
689688
}

src/leetCodeManager.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class LeetCodeManager extends EventEmitter {
8383
env: createEnvOption(),
8484
});
8585

86-
childProc.stdout.on("data", async (data: string | Buffer) => {
86+
childProc.stdout?.on("data", async (data: string | Buffer) => {
8787
data = data.toString();
8888
leetCodeChannel.append(data);
8989
if (data.includes("twoFactorCode")) {
@@ -96,19 +96,19 @@ class LeetCodeManager extends EventEmitter {
9696
childProc.kill();
9797
return resolve(undefined);
9898
}
99-
childProc.stdin.write(`${twoFactor}\n`);
99+
childProc.stdin?.write(`${twoFactor}\n`);
100100
}
101101
const successMatch: RegExpMatchArray | null = data.match(this.successRegex);
102102
if (successMatch && successMatch[1]) {
103-
childProc.stdin.end();
103+
childProc.stdin?.end();
104104
return resolve(successMatch[1]);
105105
} else if (data.match(this.failRegex)) {
106-
childProc.stdin.end();
106+
childProc.stdin?.end();
107107
return reject(new Error("Faile to login"));
108108
}
109109
});
110110

111-
childProc.stderr.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString()));
111+
childProc.stderr?.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString()));
112112

113113
childProc.on("error", reject);
114114
const name: string | undefined = await vscode.window.showInputBox({
@@ -120,7 +120,7 @@ class LeetCodeManager extends EventEmitter {
120120
childProc.kill();
121121
return resolve(undefined);
122122
}
123-
childProc.stdin.write(`${name}\n`);
123+
childProc.stdin?.write(`${name}\n`);
124124
const pwd: string | undefined = await vscode.window.showInputBox({
125125
prompt: isByCookie ? "Enter cookie" : "Enter password.",
126126
password: true,
@@ -131,7 +131,7 @@ class LeetCodeManager extends EventEmitter {
131131
childProc.kill();
132132
return resolve(undefined);
133133
}
134-
childProc.stdin.write(`${pwd}\n`);
134+
childProc.stdin?.write(`${pwd}\n`);
135135
});
136136
if (userName) {
137137
vscode.window.showInformationMessage(`Successfully ${inMessage}.`);

src/utils/cpUtils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ export async function executeCommand(command: string, args: string[], options: c
1515

1616
const childProc: cp.ChildProcess = cp.spawn(command, args, { ...options, env: createEnvOption() });
1717

18-
childProc.stdout.on("data", (data: string | Buffer) => {
18+
childProc.stdout?.on("data", (data: string | Buffer) => {
1919
data = data.toString();
2020
result = result.concat(data);
2121
leetCodeChannel.append(data);
2222
});
2323

24-
childProc.stderr.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString()));
24+
childProc.stderr?.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString()));
2525

2626
childProc.on("error", reject);
2727

@@ -42,7 +42,7 @@ export async function executeCommand(command: string, args: string[], options: c
4242
export async function executeCommandWithProgress(message: string, command: string, args: string[], options: cp.SpawnOptions = { shell: true }): Promise<string> {
4343
let result: string = "";
4444
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification }, async (p: vscode.Progress<{}>) => {
45-
return new Promise(async (resolve: () => void, reject: (e: Error) => void): Promise<void> => {
45+
return new Promise<void>(async (resolve: () => void, reject: (e: Error) => void): Promise<void> => {
4646
p.report({ message });
4747
try {
4848
result = await executeCommand(command, args, options);

src/webview/leetCodePreviewProvider.ts

-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
130130

131131
protected onDidDisposeWebview(): void {
132132
super.onDidDisposeWebview();
133-
delete this.node;
134-
delete this.description;
135133
this.sideMode = false;
136134
}
137135

src/webview/leetCodeSolutionProvider.ts

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class LeetCodeSolutionProvider extends LeetCodeWebview {
6464

6565
protected onDidDisposeWebview(): void {
6666
super.onDidDisposeWebview();
67-
delete this.solution;
6867
}
6968

7069
private parseSolution(raw: string): Solution {

src/webview/leetCodeSubmissionProvider.ts

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class LeetCodeSubmissionProvider extends LeetCodeWebview {
5959

6060
protected onDidDisposeWebview(): void {
6161
super.onDidDisposeWebview();
62-
delete this.result;
6362
}
6463

6564
private async showKeybindingsHint(): Promise<void> {

0 commit comments

Comments
 (0)