"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
function getJsonFileContent(tree, filepath) {
    try {
        const content = tree.read(filepath);
        if (!content) {
            throw new schematics_1.SchematicsException('File does not exist');
        }
        return JSON.parse(content.toString());
    }
    catch (err) {
        throw new schematics_1.SchematicsException(`Cannot parse file ${filepath} as JSON. ${err.message}`);
    }
}
exports.getJsonFileContent = getJsonFileContent;
//# sourceMappingURL=schematics.js.map