packages/hast-util-to-babel-ast/src/stringToObjectStyle.js
function stringToObjectStyle(rawStyle) {
  const entries = rawStyle.split(';')
  const properties = []

  let index = -1

  while (++index < entries.length) {
    const entry = entries[index]
    const style = entry.trim()
    const firstColon = style.indexOf(':')
    const value = style.substr(firstColon + 1).trim()
    const key = style.substr(0, firstColon)
    if (key !== '') {
      const property = t.objectProperty(formatKey(key), formatValue(value))
      properties.push(property)
    }
  }

  return t.objectExpression(properties)
}
function stringToObjectStyle(rawStyle) {
  const entries = rawStyle.split(';')
  const properties = []

  let index = -1

  while (++index < entries.length) {
    const entry = entries[index]
    const style = entry.trim()
    const firstColon = style.indexOf(':')
    const value = style.substr(firstColon + 1).trim()
    const key = style.substr(0, firstColon)
    if (key !== '') {
      const property = t.objectProperty(formatKey(key), formatValue(value))
      properties.push(property)
    }
  }

  return t.objectExpression(properties)
}
function stringToObjectStyle ( rawStyle ) { const entries = rawStyle . split ( ';' ) const properties = [ ] let index = - 1 while ( ++ index < entries . length ) { const entry = entries [ index ] const style = entry . trim ( ) const firstColon = style . indexOf ( ':' ) const value = style . substr ( firstColon + 1 ) . trim ( ) const key = style . substr ( 0 , firstColon ) if ( key !== '' ) { const property = t . objectProperty ( formatKey ( key ) , formatValue ( value ) ) properties . push ( property ) } } return t . objectExpression ( properties ) }
Handle parsing of inline styles.

@param {string} rawStyle
@returns {object}
Handle parsing of inline styles .