Angular 原理图中的 branchAndMerge 函数有什么作用?

Mar*_*nJH 5 angular angular-schematics

我正在试验 Angular 原理图,并在不同的地方遇到了函数 branchAndMerge()。然而,没有人解释它的作用。

我见过的地方:

澄清它与合并/合并的区别,以及如何正确使用它,将不胜感激。

PS:合并在@angular-devkit/schematics解释如下:

将输入树与其他树合并。

顺便说一句,我假设merge() 现在是mergeWith,尽管我不是100% 确定。

代码示例

const rule = 
    // Creates a new rule that is a concatenation of other rules.
    chain([
      // Everyone uses it, but no one explains what it does...
      branchAndMerge(
        chain([
        // Merges the project tree with the virtual tree
        mergeWith(virtualTree)
      ]))
    ]);
Run Code Online (Sandbox Code Playgroud)

Cha*_*man 2

以下视频给出了迄今为止我听过的最好的解释:

当前树的分支,该树是基于当前目录的虚拟文件系统

如果人们查看repo 中的代码,就会发现情况确实如此。我想这样做的好处是出于性能原因,其中它允许修改键/值而不是实际的硬盘。此外,我想它也会简化过程,因为它使位置变得无关紧要,这会使原理图的过程大大复杂化。