function normalizeRowColumn (str) {
  let normalized = parser(str)
    .nodes
    .reduce((result, node) => {
      if (node.type === 'function' && node.value === 'repeat') {
        let key = 'count'

        let [count, value] = node.nodes.reduce((acc, n) => {
          if (n.type === 'word' && key === 'count') {
            acc[0] = Math.abs(parseInt(n.value))
            return acc
          }
          if (n.type === 'div' && n.value === ',') {
            key = 'value'
            return acc
          }
          if (key === 'value') {
            acc[1] += parser.stringify(n)
          }
          return acc
        }, [0, ''])

        if (count) {
          for (let i = 0; i < count; i++) {
            result.push(value)
          }
        }

        return result
      }
      if (node.type === 'space') {
        return result
      }
      return result.concat(parser.stringify(node))
    }, [])

  return normalized
}
function normalizeRowColumn (str) {
  let normalized = parser(str)
    .nodes
    .reduce((result, node) => {
      if (node.type === 'function' && node.value === 'repeat') {
        let key = 'count'

        let [count, value] = node.nodes.reduce((acc, n) => {
          if (n.type === 'word' && key === 'count') {
            acc[0] = Math.abs(parseInt(n.value))
            return acc
          }
          if (n.type === 'div' && n.value === ',') {
            key = 'value'
            return acc
          }
          if (key === 'value') {
            acc[1] += parser.stringify(n)
          }
          return acc
        }, [0, ''])

        if (count) {
          for (let i = 0; i < count; i++) {
            result.push(value)
          }
        }

        return result
      }
      if (node.type === 'space') {
        return result
      }
      return result.concat(parser.stringify(node))
    }, [])

  return normalized
}
function normalizeRowColumn ( str ) { let normalized = parser ( str ) . nodes . reduce ( ( result , node ) => { if ( node . type === 'function' && node . value === 'repeat' ) { let key = 'count' let [ count , value ] = node . nodes . reduce ( ( acc , n ) => { if ( n . type === 'word' && key === 'count' ) { acc [ 0 ] = Math . abs ( parseInt ( n . value ) ) return acc } if ( n . type === 'div' && n . value === ',' ) { key = 'value' return acc } if ( key === 'value' ) { acc [ 1 ] += parser . stringify ( n ) } return acc } , [ 0 , '' ] ) if ( count ) { for ( let i = 0 ; i < count ; i ++ ) { result . push ( value ) } } return result } if ( node . type === 'space' ) { return result } return result . concat ( parser . stringify ( node ) ) } , [ ] ) return normalized }
normalize the grid-template-rows/columns values
@param  {String} str grid-template-rows/columns value
@return {Array} normalized array with values
@example
let normalized = normalizeRowColumn('1fr repeat(2, 20px 50px) 1fr')
normalized // <= ['1fr', '20px', '50px', '20px', '50px', '1fr']
normalize the grid - template - rows / columns values
normalize a row column