@valantic/spartacus-mock
Version:
This project offers you the possibility to mock the OCC Endpoints of your Composable Storefront (Spartacus). It uses the Mock Service Worker to mock the API calls.
22 lines • 925 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.readPackageJson = readPackageJson;
exports.dependencyExists = dependencyExists;
exports.createNodePackageInstallationTask = createNodePackageInstallationTask;
const schematics_1 = require("@angular-devkit/schematics");
const tasks_1 = require("@angular-devkit/schematics/tasks");
function readPackageJson(tree) {
const pkgPath = '/package.json';
const buffer = tree.read(pkgPath);
if (!buffer) {
throw new schematics_1.SchematicsException('Could not find package.json');
}
return JSON.parse(buffer.toString('utf-8'));
}
function dependencyExists(dependency, packageJson) {
return packageJson[dependency.type]?.hasOwnProperty(dependency.name);
}
function createNodePackageInstallationTask(context) {
return context.addTask(new tasks_1.NodePackageInstallTask());
}
//# sourceMappingURL=package-utils.js.map