Skip to content

Commit 2c65471

Browse files
committed
refactor: use native Array.isArray instead of lodash/isArray
1 parent 166cbb7 commit 2c65471

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

@commitlint/parse/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@
3636
"devDependencies": {
3737
"@commitlint/test": "8.2.0",
3838
"@commitlint/utils": "^8.3.4",
39-
"@types/lodash": "4.14.149",
4039
"import-from": "3.0.0"
4140
},
4241
"dependencies": {
4342
"conventional-changelog-angular": "^5.0.0",
44-
"conventional-commits-parser": "^3.0.0",
45-
"lodash": "^4.17.15"
43+
"conventional-commits-parser": "^3.0.0"
4644
}
4745
}

@commitlint/parse/src/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import mergeWith from 'lodash/mergeWith';
2-
import isArray from 'lodash/isArray';
32
import {Commit, Parser, ParserOptions} from '@commitlint/types';
43

54
const {sync} = require('conventional-commits-parser');
@@ -14,7 +13,7 @@ async function parse(
1413
): Promise<Commit> {
1514
const defaultOpts = (await defaultChangelogOpts).parserOpts;
1615
const opts = mergeWith({}, defaultOpts, parserOpts, (objValue, srcValue) => {
17-
if (isArray(objValue)) return srcValue;
16+
if (Array.isArray(objValue)) return srcValue;
1817
});
1918
const parsed = parser(message, opts) as Commit;
2019
parsed.raw = message;

@commitlint/resolve-extends/src/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import path from 'path';
22

33
import 'resolve-global';
44
import resolveFrom from 'resolve-from';
5-
import isArray from 'lodash/isArray';
65
import merge from 'lodash/merge';
76
import mergeWith from 'lodash/mergeWith';
87
import omit from 'lodash/omit';
@@ -37,7 +36,7 @@ export default function resolveExtends(
3736
const extended = loadExtends(config, context).reduceRight(
3837
(r, c) =>
3938
mergeWith(r, omit(c, 'extends'), (objValue, srcValue) => {
40-
if (isArray(objValue)) {
39+
if (Array.isArray(objValue)) {
4140
return srcValue;
4241
}
4342
}),

0 commit comments

Comments
 (0)