"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RegexManagersMigration = void 0;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
const abstract_migration_1 = require("../base/abstract-migration");
class RegexManagersMigration extends abstract_migration_1.AbstractMigration {
    propertyName = 'regexManagers';
    run(value) {
        if (is_1.default.nonEmptyArray(value)) {
            const regexManagers = value.map((mgr) => {
                if (mgr.customType) {
                    return mgr;
                }
                return Object.assign({ customType: 'regex' }, mgr); // to make sure customType is at top, looks good when migration pr is created
            });
            this.rewrite(regexManagers);
        }
    }
}
exports.RegexManagersMigration = RegexManagersMigration;
//# sourceMappingURL=regex-managers-migration.js.map