Skip to content

Commit 517b8b2

Browse files
authored
refactor: use native Array.isArray instead of lodash/isArray (#974)
1 parent 908ff52 commit 517b8b2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

@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)