@datorama/akita
Version:
State Management Tailored-Made for JS Applications
20 lines • 750 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
function getWorkspacePath(host) {
const possibleFiles = ['/angular.json', '/.angular.json'];
const path = possibleFiles.filter(path => host.exists(path))[0];
return path;
}
exports.getWorkspacePath = getWorkspacePath;
function getWorkspace(host) {
const path = getWorkspacePath(host);
const configBuffer = host.read(path);
if (configBuffer === null) {
throw new schematics_1.SchematicsException(`Could not find (${path})`);
}
const config = configBuffer.toString();
return JSON.parse(config);
}
exports.getWorkspace = getWorkspace;
//# sourceMappingURL=workspace.js.map