"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyPageMigrations = applyPageMigrations;
const defaults_1 = require("../defaults");
const migratePageSlugAndOrgUrlKey_1 = require("./migratePageSlugAndOrgUrlKey");
/**
 * Apply project migrations.
 * Exported for testing purposes. This is not exported from the main module.
 * @param page
 * @returns
 */
function applyPageMigrations(page) {
    // Ensure the orgUrlKey is lowercase and the slug is updated accordingly
    if (page.schemaVersion === defaults_1.HUB_PAGE_CURRENT_SCHEMA_VERSION) {
        return page;
    }
    // Apply the migrations
    const migrated = (0, migratePageSlugAndOrgUrlKey_1.migratePageSlugAndOrgUrlKey)(page);
    // add more migration here as needed
    // e.g. migrated = anotherMigration(migrated);
    return migrated;
}
//# sourceMappingURL=applyPageMigrations.js.map