"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findAndUpdateDependencyVersions = exports.expoGoCompatExpectedVersions = void 0;
// The expoGoCompat object specifies version overrides for packages that are not
// compatible with the Expo Go app. We use this object to specify the latest compatible
// version of each package when generating a new project using Expo Go.
// New ignited apps using prebuild will have more up-to-date versions of these packages.
exports.expoGoCompatExpectedVersions = {
    "@react-native-async-storage/async-storage": "1.18.2",
    "expo-application": "~5.3.0",
    "expo-font": "~11.4.0",
    "expo-localization": "~14.3.0",
    "@shopify/flash-list": "1.4.3",
};
// This function takes a package.json file as a string and updates the versions of the
// dependencies specified in expoGoCompatExpectedVersions to the values in that object
// and returns the updated package.json as a string.
// This function is used when generating a new project using Expo Go.
function findAndUpdateDependencyVersions(packageJsonRaw, dependencies) {
    var updatedPackageJson = packageJsonRaw;
    Object.keys(dependencies).forEach(function (depName) {
        var desiredVersion = dependencies[depName];
        var regex = new RegExp("\"".concat(depName, "\"\\s*:\\s*\"[^\"]+\""), "g");
        updatedPackageJson = updatedPackageJson.replace(regex, "\"".concat(depName, "\": \"").concat(desiredVersion, "\""));
    });
    return updatedPackageJson;
}
exports.findAndUpdateDependencyVersions = findAndUpdateDependencyVersions;
//# sourceMappingURL=expoGoCompatibility.js.map