Custom function to insert a declaration (component, pipe, directive) into NgModule declarations. It also imports the component.
Custom function to insert an entryComponent into NgModule. It also imports it.
Custom function to insert an export into NgModule. It also imports it.
Custom function to insert an NgModule into NgModule imports. It also imports the module.
Custom function to insert a provider into NgModule. It also imports it.
Adds a new route declaration to a router module (i.e. has a RouterModule declaration)
Find all nodes from the AST in the subtree of node of SyntaxKind kind.
The maximum number of items to return.
Continue looking for nodes of kind recursive until end the last child even when node of kind has been found.
all nodes of kind, or [] if none is found
Given a source file with @NgModule class(es), find the name of the first @NgModule class.
source file containing one or more @NgModule
the name of the first @NgModule, or undefined
if none is found
Returns the RouterModule declaration from NgModule metadata, if any.
Get all the nodes from a source.
The source file object.
An observable of all the nodes in the source.
Insert toInsert
after the last occurence of ts.SyntaxKind[nodes[i].kind]
or after the last of occurence of syntaxKind
if the last occurence is a sub child
of ts.SyntaxKind[nodes[i].kind] and save the changes in file.
insert after the last occurence of nodes
string to insert
file to insert changes into
position to insert if toInsert happens to be the first occurence
the ts.SyntaxKind of the subchildren to insert after
Change instance
Add Import import { symbolName } from fileName
if the import doesn't exit
already. Assumes fileToEdit can be resolved and accessed.
(file we want to add import to)
(item to import)
(path to the file)
(if true, import follows style for importing default exports)
Change
Determine if an import already exists.
Custom function to insert an export into NgModule. It also imports it.