Skip to content

Commit

Permalink
refactor: use native Array.isArray instead of lodash/isArray (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Feb 7, 2020
1 parent 908ff52 commit 517b8b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions @commitlint/parse/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import mergeWith from 'lodash/mergeWith';
import isArray from 'lodash/isArray';
import {Commit, Parser, ParserOptions} from '@commitlint/types';

const {sync} = require('conventional-commits-parser');
Expand All @@ -14,7 +13,7 @@ async function parse(
): Promise<Commit> {
const defaultOpts = (await defaultChangelogOpts).parserOpts;
const opts = mergeWith({}, defaultOpts, parserOpts, (objValue, srcValue) => {
if (isArray(objValue)) return srcValue;
if (Array.isArray(objValue)) return srcValue;
});
const parsed = parser(message, opts) as Commit;
parsed.raw = message;
Expand Down
3 changes: 1 addition & 2 deletions @commitlint/resolve-extends/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import path from 'path';

import 'resolve-global';
import resolveFrom from 'resolve-from';
import isArray from 'lodash/isArray';
import merge from 'lodash/merge';
import mergeWith from 'lodash/mergeWith';
import omit from 'lodash/omit';
Expand Down Expand Up @@ -37,7 +36,7 @@ export default function resolveExtends(
const extended = loadExtends(config, context).reduceRight(
(r, c) =>
mergeWith(r, omit(c, 'extends'), (objValue, srcValue) => {
if (isArray(objValue)) {
if (Array.isArray(objValue)) {
return srcValue;
}
}),
Expand Down

0 comments on commit 517b8b2

Please sign in to comment.