Skip to content

Commit a6367f5

Browse files
authored
Correct the usage of lodash (LeetCode-OpenSource#242)
1 parent ab33742 commit a6367f5

File tree

3 files changed

+16
-27
lines changed

3 files changed

+16
-27
lines changed

package-lock.json

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

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
"devDependencies": {
310310
"@types/fs-extra": "5.0.0",
311311
"@types/highlight.js": "^9.12.3",
312-
"@types/lodash.kebabcase": "^4.1.5",
312+
"@types/lodash": "^4.14.123",
313313
"@types/markdown-it": "0.0.7",
314314
"@types/mocha": "^2.2.42",
315315
"@types/node": "^7.0.43",
@@ -322,7 +322,6 @@
322322
"fs-extra": "^6.0.1",
323323
"highlight.js": "^9.15.6",
324324
"lodash": "^4.17.11",
325-
"lodash.kebabcase": "^4.1.1",
326325
"markdown-it": "^8.4.2",
327326
"require-from-string": "^2.0.2",
328327
"vsc-leetcode-cli": "2.6.2"

src/utils/problemUtils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) jdneo. All rights reserved.
22
// Licensed under the MIT license.
33

4-
import kebabCase = require("lodash.kebabcase");
4+
import * as _ from "lodash";
55
import { IProblem, langExt } from "../shared";
66

77
export function genFileExt(language: string): string {
@@ -13,7 +13,7 @@ export function genFileExt(language: string): string {
1313
}
1414

1515
export function genFileName(node: IProblem, language: string): string {
16-
const slug: string = kebabCase(node.name);
16+
const slug: string = _.kebabCase(node.name);
1717
const ext: string = genFileExt(language);
1818
return `${node.id}.${slug}.${ext}`;
1919
}

0 commit comments

Comments
 (0)