source: trip-planner-front/node_modules/rxjs/migrations/update-6_0_0/index.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var schematics_1 = require("@angular-devkit/schematics");
4var tasks_1 = require("@angular-devkit/schematics/tasks");
5var rxjsCompatVersion = '^6.0.0-rc.0';
6function rxjsV6MigrationSchematic(_options) {
7 return function (tree, context) {
8 var pkgPath = '/package.json';
9 var buffer = tree.read(pkgPath);
10 if (buffer == null) {
11 throw new schematics_1.SchematicsException('Could not read package.json');
12 }
13 var content = buffer.toString();
14 var pkg = JSON.parse(content);
15 if (pkg === null || typeof pkg !== 'object' || Array.isArray(pkg)) {
16 throw new schematics_1.SchematicsException('Error reading package.json');
17 }
18 if (!pkg.dependencies) {
19 pkg.dependencies = {};
20 }
21 pkg.dependencies['rxjs-compat'] = rxjsCompatVersion;
22 tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2));
23 context.addTask(new tasks_1.NodePackageInstallTask());
24 return tree;
25 };
26}
27exports.rxjsV6MigrationSchematic = rxjsV6MigrationSchematic;
28//# sourceMappingURL=index.js.map
Note: See TracBrowser for help on using the repository browser.