text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.messages = exports.ruleName = undefined;
  
  exports.default = function (expectation) {
    return function (root, result) {
      var validOptions = (0, _utils.validateOptions)(result, ruleName, {
        actual: expectation,
        possible: ["lower", "upper"]
      });
      if (!validOptions) {
        return;
      }
  
      root.walkDecls(function (decl) {
        (0, _postcssValueParser2.default)(decl.value).walk(function (node) {
          // Ignore wrong units within `url` function
          if (node.type === "function" && node.value.toLowerCase() === "url") {
            return false;
          }
  
          var unit = (0, _utils.getUnitFromValueNode)(node);
  
          if (!unit) {
            return;
          }
  
          var expectedUnit = expectation === "lower" ? unit.toLowerCase() : unit.toUpperCase();
  
          if (unit === expectedUnit) {
            return;
          }
  
          (0, _utils.report)({
            message: messages.expected(unit, expectedUnit),
            node: decl,
            index: (0, _utils.declarationValueIndex)(decl) + node.sourceIndex,
            result: result,
            ruleName: ruleName
          });
        });
      });
    };
  };
  
  var _postcssValueParser = require("postcss-value-parser");
  
  var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
  
  var _utils = require("../../utils");
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var ruleName = exports.ruleName = "unit-case";
  
  var messages = (0, _utils.ruleMessages)(ruleName, {
    expected: function expected(actual, _expected) {
      return "Expected \"" + actual + "\" to be \"" + _expected + "\"";
    }
  });
  
  exports.messages = messages;