"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.YAMLFormatter = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _standalone = _interopRequireDefault(require("prettier/standalone"));

var _parserYaml = _interopRequireDefault(require("prettier/parser-yaml"));

var YAMLFormatter = /*#__PURE__*/function () {
  function YAMLFormatter() {
    (0, _classCallCheck2["default"])(this, YAMLFormatter);
  }

  (0, _createClass2["default"])(YAMLFormatter, [{
    key: "getFormatted",
    value: function getFormatted(rawText) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : YAMLFormatter.defaultOptions;
      var t = rawText;

      try {
        t = _standalone["default"].format(rawText, options);
      } catch (error) {// 
      }

      return t;
    }
  }, {
    key: "getRaw",
    value: function getRaw(formattedText) {
      return formattedText; // do nothing
    }
  }]);
  return YAMLFormatter;
}();

exports.YAMLFormatter = YAMLFormatter;
YAMLFormatter.defaultOptions = {
  parser: 'yaml',
  plugins: [_parserYaml["default"]]
};

var _default = new YAMLFormatter();

exports["default"] = _default;
//# sourceMappingURL=YAMLFormatter.js.map
