From 6d28ab85340d1dcf7dd8e26ab3714d5e2afb69ab Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 7 Feb 2020 20:12:38 +0100 Subject: [PATCH] refactor: use native Array.isArray instead of lodash/isArray --- @commitlint/parse/src/index.ts | 3 +-- @commitlint/resolve-extends/src/index.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/@commitlint/parse/src/index.ts b/@commitlint/parse/src/index.ts index 8074362dc2..846253f109 100644 --- a/@commitlint/parse/src/index.ts +++ b/@commitlint/parse/src/index.ts @@ -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'); @@ -14,7 +13,7 @@ async function parse( ): Promise { 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; diff --git a/@commitlint/resolve-extends/src/index.ts b/@commitlint/resolve-extends/src/index.ts index 9a94e5ba03..3e0c2acf23 100644 --- a/@commitlint/resolve-extends/src/index.ts +++ b/@commitlint/resolve-extends/src/index.ts @@ -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'; @@ -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; } }),