[READ-ONLY] Mirror of https://github.com/hacknug/tailwindcss-plugin-utils. A bunch of utilities to help you create and maintain plugins for Tailwind. www.npmjs.com/package/@hacknug/tailwindcss-plugin-utils
0

Configure Feed

Select the types of activity you want to include in your feed.

Attempt to fix Jest issues exporting functions directly

Nestor Vera (Jul 15, 2019, 5:52 PM +0200) b905ec0f 8b2e940c

+8 -6
+8 -6
src/index.js
··· 13 13 * @param {*} base 14 14 */ 15 15 16 - export const handleName = (className, base) => { 16 + export function handleName (className, base) { 17 17 const split = className.split(`${base}-`) 18 18 const prefixedName = `${split[0]}${prefixNegativeModifiers(base, split[1])}` 19 19 20 20 return prefixedName.split('-default').join('') 21 21 } 22 22 23 - export const prefixNegativeModifiers = (base, modifier) => { 23 + export function prefixNegativeModifiers (base, modifier) { 24 24 return _.startsWith(modifier, '-') ? `-${base}-${modifier.slice(1)}` : `${base}-${modifier}` 25 25 } 26 26 ··· 30 30 * @param {...any} fallbackKeys 31 31 */ 32 32 33 - export const buildConfig = (themeKey, ...fallbackKeys) => { 33 + export function buildConfig (themeKey, ...fallbackKeys) { 34 34 const themeHoldsConfig = getThemeSettings(themeKey, fallbackKeys) 35 35 36 - const settings = themeHoldsConfig ? getThemeSettings(themeKey, fallbackKeys) : getPluginSettings(themeKey, fallbackKeys) 36 + const settings = themeHoldsConfig 37 + ? getThemeSettings(themeKey, fallbackKeys) 38 + : getPluginSettings(themeKey, fallbackKeys) 37 39 const object = _.isArray(settings) ? _.zipObject(settings, settings) : settings 38 40 const entries = settings && Object.entries(themeHoldsConfig ? flatten(object, FLATTEN_CONFIG) : object) 39 41 .map(([modifier, value]) => [modifier, { [themeKey]: value }]) ··· 41 43 return settings ? _.fromPairs(entries) : false 42 44 } 43 45 44 - export const getThemeSettings = (themeKey, fallbackKeys = []) => { 46 + export function getThemeSettings (themeKey, fallbackKeys = []) { 45 47 const [newThemeKey, ...newFallbackKeys] = fallbackKeys 46 48 47 49 return ( ··· 50 52 ) 51 53 } 52 54 53 - export const getPluginSettings = (themeKey, fallbackKeys = []) => { 55 + export function getPluginSettings (themeKey, fallbackKeys = []) { 54 56 const [newThemeKey, ...newFallbackKeys] = fallbackKeys 55 57 56 58 return (