Replaces use of Lodash isArray with built-in Array.isArray

This commit is contained in:
ecrmnn 2019-07-13 16:52:07 +02:00
parent c9bba9d1b1
commit 66e75b89ab
7 changed files with 7 additions and 9 deletions

View File

@ -6,7 +6,7 @@ export default function(config) {
functions: {
theme: (path, ...defaultValue) => {
return _.thru(_.get(config.theme, _.trim(path, `'"`), defaultValue), value => {
return _.isArray(value) ? value.join(', ') : value
return Array.isArray(value) ? value.join(', ') : value
})
},
},

View File

@ -7,7 +7,7 @@ function extractMinWidths(breakpoints) {
breakpoints = { min: breakpoints }
}
if (!_.isArray(breakpoints)) {
if (!Array.isArray(breakpoints)) {
breakpoints = [breakpoints]
}

View File

@ -7,7 +7,7 @@ export default function() {
return [
`.${e(`font-${modifier}`)}`,
{
'font-family': _.isArray(value) ? value.join(', ') : value,
'font-family': Array.isArray(value) ? value.join(', ') : value,
},
]
})

View File

@ -5,7 +5,7 @@ export default function buildMediaQuery(screens) {
screens = { min: screens }
}
if (!_.isArray(screens)) {
if (!Array.isArray(screens)) {
screens = [screens]
}

View File

@ -32,7 +32,7 @@ export default function(plugins, config) {
config: getConfigValue,
theme: (path, defaultValue) => getConfigValue(`theme.${path}`, defaultValue),
variants: (path, defaultValue) => {
if (_.isArray(config.variants)) {
if (Array.isArray(config.variants)) {
return config.variants
}

View File

@ -1,4 +1,3 @@
import _ from 'lodash'
import postcss from 'postcss'
import cloneNodes from './cloneNodes'
@ -7,5 +6,5 @@ export default function responsive(rules) {
.atRule({
name: 'responsive',
})
.append(cloneNodes(_.isArray(rules) ? rules : [rules]))
.append(cloneNodes(Array.isArray(rules) ? rules : [rules]))
}

View File

@ -1,4 +1,3 @@
import _ from 'lodash'
import postcss from 'postcss'
import cloneNodes from './cloneNodes'
@ -8,5 +7,5 @@ export default function wrapWithVariants(rules, variants) {
name: 'variants',
params: variants.join(', '),
})
.append(cloneNodes(_.isArray(rules) ? rules : [rules]))
.append(cloneNodes(Array.isArray(rules) ? rules : [rules]))
}