{"size": 1781, "ext": "js", "max_stars_repo_path": "packages/plugins/src/core/prettierFactory.js", "max_stars_repo_name": "kiner-tang/octopus", "max_stars_repo_stars_event_min_datetime": "2022-03-01T09:21:15.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-03T02:16:07.000Z", "max_issues_repo_path": "packages/plugins/src/core/prettierFactory.js", "max_issues_repo_name": "kiner-tang/octopus", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/plugins/src/core/prettierFactory.js", "max_forks_repo_name": "kiner-tang/octopus", "max_forks_repo_forks_event_min_datetime": "2022-03-01T09:21:11.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-01T09:21:11.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 44.525, "max_line_length": 110, "alphanum_fraction": 0.6170690623}
"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrettierFactory = void 0;
var octopus_shared_1 = require("@kiner/octopus-shared");
var prettier_1 = __importDefault(require("prettier"));
var PrettierFactory = /** @class */ (function (_super) {
    __extends(PrettierFactory, _super);
    function PrettierFactory() {
        return _super.call(this, "Prettier") || this;
    }
    PrettierFactory.prototype.resolveData = function (data) {
        data.forEach(function (item) { return item.codes.forEach(function (code) {
            if (code.prettier) {
                code.code = prettier_1.default.format(code.code, code.prettierOptions);
            }
        }); });
        return _super.prototype.resolveData.call(this, data);
    };
    return PrettierFactory;
}(octopus_shared_1.BaseApp));
exports.PrettierFactory = PrettierFactory;
