jsonFormatter.js 786 B

12345678910111213141516171819
  1. "use strict";
  2. var __extends = (this && this.__extends) || function (d, b) {
  3. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4. function __() { this.constructor = d; }
  5. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6. };
  7. var abstractFormatter_1 = require("../language/formatter/abstractFormatter");
  8. var Formatter = (function (_super) {
  9. __extends(Formatter, _super);
  10. function Formatter() {
  11. _super.apply(this, arguments);
  12. }
  13. Formatter.prototype.format = function (failures) {
  14. var failuresJSON = failures.map(function (failure) { return failure.toJson(); });
  15. return JSON.stringify(failuresJSON);
  16. };
  17. return Formatter;
  18. }(abstractFormatter_1.AbstractFormatter));
  19. exports.Formatter = Formatter;