How to use the @ngrx/router-store/schematics-core.visitTSSourceFiles function in @ngrx/router-store

To help you get started, we’ve selected a few @ngrx/router-store examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ngrx / platform / modules / router-store / migrations / 8_0_0 / index.ts View on Github external
return (tree: Tree) => {
    visitTSSourceFiles(tree, sourceFile => {
      let changes: ReplaceChange[] = [];
      ts.forEachChild(sourceFile, function findDecorator(node) {
        if (!ts.isDecorator(node)) {
          ts.forEachChild(node, findDecorator);
          return;
        }

        ts.forEachChild(node, function findImports(node) {
          if (
            ts.isPropertyAssignment(node) &&
            ts.isArrayLiteralExpression(node.initializer) &&
            ts.isIdentifier(node.name) &&
            node.name.text === 'imports'
          ) {
            node.initializer.elements
              .filter(ts.isIdentifier)