"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseLocalizationCatalogFromItem = void 0;
const SchemaValidation_1 = require("../../jsonschema/SchemaValidation");
const StorageUtilities_1 = require("../../storage/StorageUtilities");
async function parseLocalizationCatalogFromItem(item) {
    const file = item && (await item.loadFileContent());
    const json = file && StorageUtilities_1.default.getJsonObject(file);
    const [langs, errors] = (0, SchemaValidation_1.validateJsonAndAssert)(json, {
        type: "array",
        items: {
            type: "string",
        },
    });
    if (errors) {
        return [null, errors];
    }
    return [{ langs }, null];
}
exports.parseLocalizationCatalogFromItem = parseLocalizationCatalogFromItem;

//# sourceMappingURL=../../maps/app/localization/LocalizationCatalog.js.map
