"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = transform;
exports.toTransformValue = toTransformValue;

var _isEmpty = _interopRequireDefault(require("./isEmpty"));

function toTransformValue(value) {
  return Object.keys(value).reduce(function (values, key) {
    var v = value[key];

    if (!(0, _isEmpty["default"])(v)) {
      values.push("".concat(key, "(").concat(v, ")"));
    }

    return values;
  }, []).join(' ');
}

function transform(value, style) {
  if (style) {
    style.transform = value;
    style.webkitTransform = value;
    return;
  }

  return ['-webkit-', '-ms-', ''].map(function (prefix) {
    return "".concat(prefix, "transform:").concat(value);
  }).join(';');
}
//# sourceMappingURL=transform.js.map
