mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Replaces use of Lodash isArray with built-in Array.isArray
This commit is contained in:
parent
c9bba9d1b1
commit
66e75b89ab
@ -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
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@ -7,7 +7,7 @@ function extractMinWidths(breakpoints) {
|
||||
breakpoints = { min: breakpoints }
|
||||
}
|
||||
|
||||
if (!_.isArray(breakpoints)) {
|
||||
if (!Array.isArray(breakpoints)) {
|
||||
breakpoints = [breakpoints]
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
},
|
||||
]
|
||||
})
|
||||
|
||||
@ -5,7 +5,7 @@ export default function buildMediaQuery(screens) {
|
||||
screens = { min: screens }
|
||||
}
|
||||
|
||||
if (!_.isArray(screens)) {
|
||||
if (!Array.isArray(screens)) {
|
||||
screens = [screens]
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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]))
|
||||
}
|
||||
|
||||
@ -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]))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user