Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
10 | exports.partition = exports.merge = exports.branch = exports.empty = void 0;
|
---|
11 | const exception_1 = require("../exception/exception");
|
---|
12 | const host_tree_1 = require("./host-tree");
|
---|
13 | const interface_1 = require("./interface");
|
---|
14 | function empty() {
|
---|
15 | return new host_tree_1.HostTree();
|
---|
16 | }
|
---|
17 | exports.empty = empty;
|
---|
18 | function branch(tree) {
|
---|
19 | return tree.branch();
|
---|
20 | }
|
---|
21 | exports.branch = branch;
|
---|
22 | function merge(tree, other, strategy = interface_1.MergeStrategy.Default) {
|
---|
23 | tree.merge(other, strategy);
|
---|
24 | return tree;
|
---|
25 | }
|
---|
26 | exports.merge = merge;
|
---|
27 | function partition(tree, predicate) {
|
---|
28 | if (tree instanceof host_tree_1.HostTree) {
|
---|
29 | return [
|
---|
30 | new host_tree_1.FilterHostTree(tree, predicate),
|
---|
31 | new host_tree_1.FilterHostTree(tree, (path, entry) => !predicate(path, entry)),
|
---|
32 | ];
|
---|
33 | }
|
---|
34 | else {
|
---|
35 | throw new exception_1.SchematicsException('Tree type is not supported.');
|
---|
36 | }
|
---|
37 | }
|
---|
38 | exports.partition = partition;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.