UNPKG

1.74 kBJavaScriptView Raw
1"use strict";
2var __assign = (this && this.__assign) || function () {
3 __assign = Object.assign || function(t) {
4 for (var s, i = 1, n = arguments.length; i < n; i++) {
5 s = arguments[i];
6 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7 t[p] = s[p];
8 }
9 return t;
10 };
11 return __assign.apply(this, arguments);
12};
13Object.defineProperty(exports, "__esModule", { value: true });
14var schematics_1 = require("@angular-devkit/schematics");
15var schematics_core_1 = require("../../schematics-core");
16function default_1(options) {
17 return function (host, context) {
18 options.path = (0, schematics_core_1.getProjectPath)(host, options);
19 var parsedPath = (0, schematics_core_1.parseName)(options.path, options.name);
20 options.name = parsedPath.name;
21 options.path = parsedPath.path;
22 var templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
23 options.skipTests
24 ? (0, schematics_1.filter)(function (path) { return !path.endsWith('.spec.ts.template'); })
25 : (0, schematics_1.noop)(),
26 (0, schematics_1.applyTemplates)(__assign(__assign(__assign({}, schematics_core_1.stringUtils), { 'if-flat': function (s) {
27 return schematics_core_1.stringUtils.group(options.flat ? '' : s, options.group ? 'data' : '');
28 } }), options)),
29 (0, schematics_1.move)(parsedPath.path),
30 ]);
31 return (0, schematics_1.chain)([(0, schematics_1.branchAndMerge)((0, schematics_1.chain)([(0, schematics_1.mergeWith)(templateSource)]))])(host, context);
32 };
33}
34exports.default = default_1;
35//# sourceMappingURL=index.js.map
\No newline at end of file