Guest User

Untitled

a guest
May 26th, 2019
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const linkPath = '/workingMode/distracted/aBit'
  2. const isDarkTheme = true
  3.  
  4. const generateSearchQuery = (strings, linkExp, searchArgument = 'gaveUp') => {
  5. let searchQuery = '?search='
  6. const [,searchQueryArg ,] = strings
  7. const themeString = isDarkTheme ? 'dark' : 'light'
  8.  
  9. if (searchQueryArg !== '') searchQuery = searchQueryArg
  10. return `/en-us${linkExp}${searchQuery}${searchArgument}?themeType=${themeString}`
  11. }
  12.  
  13. const generatePath = (index) => generateSearchQuery`${linkPath}?action=${'tryABitMore'}`
  14. // `-> '/en-us/workingMode/distracted/aBit?action=tryABitMore?themeType=dark'
  15. const generatePath = (index) => generateSearchQuery`${linkPath}?action=`
  16. // `-> '/en-us/workingMode/distracted/aBit?action=gaveUp?themeType=dark'
RAW Paste Data