Skip to content

refactor: use native Array.isArray instead of lodash/isArray #974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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