File tree 2 files changed +5
-9
lines changed
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 35
35
"del" : " ^4.1.1" ,
36
36
"execa" : " ^2.0.1" ,
37
37
"listr" : " ^0.14.3" ,
38
- "lodash" : " ^4.17.11" ,
39
38
"log-symbols" : " ^3.0.0" ,
40
39
"micromatch" : " ^4.0.2" ,
41
40
"path-is-inside" : " ^1.0.2" ,
Original file line number Diff line number Diff line change 4
4
5
5
const chalk = require ( 'chalk' )
6
6
const format = require ( 'stringify-object' )
7
- const isArray = require ( 'lodash/isArray' )
8
- const isFunction = require ( 'lodash/isFunction' )
9
- const isObject = require ( 'lodash/isObject' )
10
- const isString = require ( 'lodash/isString' )
11
7
12
8
const debug = require ( 'debug' ) ( 'lint-staged:cfg' )
13
9
@@ -36,7 +32,7 @@ module.exports = function validateConfig(config) {
36
32
37
33
const errors = [ ]
38
34
39
- if ( ! isObject ( config ) ) {
35
+ if ( ! config || typeof config !== 'object' ) {
40
36
errors . push ( 'Configuration should be an object!' )
41
37
} else {
42
38
const globs = Object . keys ( config )
@@ -47,9 +43,10 @@ module.exports = function validateConfig(config) {
47
43
48
44
globs . forEach ( key => {
49
45
if (
50
- ( ! isArray ( config [ key ] ) || config [ key ] . some ( item => ! isString ( item ) && ! isFunction ( item ) ) ) &&
51
- ! isString ( config [ key ] ) &&
52
- ! isFunction ( config [ key ] )
46
+ ( ! Array . isArray ( config [ key ] ) ||
47
+ config [ key ] . some ( item => typeof item !== 'string' && typeof item !== 'function' ) ) &&
48
+ typeof config [ key ] !== 'string' &&
49
+ typeof config [ key ] !== 'function'
53
50
) {
54
51
errors . push (
55
52
createError (
You can’t perform that action at this time.
0 commit comments