rofrischmann/fela

View on GitHub
packages/fela-plugin-typescript/src/index.js

Summary

Maintainability
A
35 mins
Test Coverage
import isPlainObject from 'isobject'

function typescript(style) {
  for (const property in style) {
    const value = style[property]

    if (property === 'nested' && isPlainObject(value)) {
      Object.assign(style, typescript(value))
      delete style.nested
    } else if (isPlainObject(value)) {
      typescript(value)
    }
  }

  return style
}

export default () => typescript