UNPKG

ink-docstrap

Version:

[![NPM](https://nodei.co/npm/ink-docstrap.png?downloads=true)](https://nodei.co/npm/ink-docstrap/)

3,601 lines (1,225 loc) 59.5 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>DocStrap Module: ink/collector</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div class="navbar-inner"> <a class="brand" href="index.html">DocStrap</a> <ul class="nav"> <li class="dropdown"> <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="module-base.html">base</a> </li> <li> <a href="chains_.html">base/chains</a> </li> <li> <a href="binder.html">documents/binder</a> </li> <li> <a href="model_.html">documents/model</a> </li> <li> <a href="probe.html">documents/probe</a> </li> <li> <a href="schema_.html">documents/schema</a> </li> <li> <a href="collector.html">ink/collector</a> </li> <li> <a href="bussable_.html">mixins/bussable</a> </li> <li> <a href="signalable_.html">mixins/signalable</a> </li> <li> <a href="format.html">strings/format</a> </li> <li> <a href="logger.html">utils/logger</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="base.html">base</a> </li> <li> <a href="chains.html">base/chains</a> </li> <li> <a href="model.html">documents/model</a> </li> <li> <a href="probe.queryOperators.html">queryOperators</a> </li> <li> <a href="probe.updateOperators.html">updateOperators</a> </li> <li> <a href="collector-ACollector.html">ACollector</a> </li> <li> <a href="collector-CollectorBase_.html">CollectorBase</a> </li> <li> <a href="collector-OCollector.html">OCollector</a> </li> <li> <a href="signalable-Signal.html">Signal</a> </li> <li> <a href="logger.Logger.html">Logger</a> </li> </ul> </li> <li class="dropdown"> <a href="mixins.list.html" class="dropdown-toggle" data-toggle="dropdown">Mixins<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="schema.html">documents/schema</a> </li> <li> <a href="bussable.html">mixins/bussable</a> </li> <li> <a href="signalable.html">mixins/signalable</a> </li> </ul> </li> <li class="dropdown"> <a href="tutorials.list.html" class="dropdown-toggle" data-toggle="dropdown">Tutorials<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="tutorial-Teeth.html">Brush Teeth</a> </li> <li> <a href="tutorial-Car.html">Drive Car</a> </li> <li> <a href="tutorial-Test.html">Fence Test</a> </li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="global.html#utils/logger">utils/logger</a> </li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span8"> <div id="main"> <h1 class="page-title">Module: ink/collector</h1> <section> <header> <h2> ink/collector </h2> </header> <article> <div class="container-overview"> <div class="description"><p>An object and array collector</p></div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-2">line 2</a> </li> </ul> </dd> </dl> </div> <h3 class="subsection-title">Classes</h3> <dl> <dt><a href="collector-ACollector.html">ACollector</a></dt> <dd></dd> <dt><a href="collector-CollectorBase_.html">CollectorBase</a></dt> <dd></dd> <dt><a href="collector-OCollector.html">OCollector</a></dt> <dd></dd> </dl> <h3 class="subsection-title">Members</h3> <dl> <dt> <h4 class="name" id="difference"><span class="type-signature"></span>difference<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Creates an array of array elements not present in the other arrays using strict equality for comparisons, i.e. ===.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-278">line 278</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="head"><span class="type-signature"></span>head<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Gets the first n values of the array</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-290">line 290</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="heap"><span class="type-signature"></span>heap<span class="type-signature"> :object|array</span></h4> </dt> <dd> <div class="description"> <p>The collection that being managed</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">object</span> | <span class="param-type">array</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-26">line 26</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="tail"><span class="type-signature"></span>tail<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>This method gets all but the first values of array</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-284">line 284</a> </li> </ul> </dd> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="collect"><span class="type-signature">&lt;static> </span>collect<span class="signature">(obj)</span><span class="type-signature"> &rarr; {ACollector|OCollector}</span></h4> </dt> <dd> <div class="description"> <p>Collect an object</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>obj</code></td> <td class="type"> <span class="param-type">array</span> | <span class="param-type">object</span> </td> <td class="description last"><p>What to collect</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-363">line 363</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">ACollector</span> | <span class="param-type">OCollector</span> </dd> </dl> </dd> <dt> <h4 class="name" id="add"><span class="type-signature">&lt;inner> </span>add<span class="signature">(item)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Adds to the top of the collection</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>item</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last"><p>The item to add to the collection. Only one item at a time can be added</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-296">line 296</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="add"><span class="type-signature">&lt;inner> </span>add<span class="signature">(key, item)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Adds an item to the collection</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last"><p>The key to use for the item being added.</p></td> </tr> <tr> <td class="name"><code>item</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last"><p>The item to add to the collection. The item is not iterated so that you could add bundled items to the collection</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-56">line 56</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="append"><span class="type-signature">&lt;inner> </span>append<span class="signature">(item)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Add to the bottom of the list</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>item</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last"><p>The item to add to the collection. Only one item at a time can be added</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-303">line 303</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="at"><span class="type-signature">&lt;inner> </span>at<span class="signature">(args)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Creates an array of elements from the specified indexes, or keys, of the collection. Indexes may be specified as individual arguments or as arrays of indexes</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">indexes</span> </td> <td class="description last"><p>The indexes to use</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-324">line 324</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="compact"><span class="type-signature">&lt;inner> </span>compact<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Modifies the collection with all falsey values of array removed. The values false, null, 0, &quot;&quot;, undefined and NaN are all falsey.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-316">line 316</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="countBy"><span class="type-signature">&lt;inner> </span>countBy<span class="signature">(<span class="optional">query</span>, iterator, <span class="optional">thisobj</span>)</span><span class="type-signature"> &rarr; {object}</span></h4> </dt> <dd> <div class="description"> <p>Creates an object composed of keys returned from running each element of the collection through the given callback. The corresponding value of each key is the number of times the key was returned by the callback.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A query to evaluate. If you pass in a query, only the items that match the query are iterated over.</p></td> </tr> <tr> <td class="name"><code>iterator</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>thisobj</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The value of <code>this</code></p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-138">line 138</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> </dd> </dl> </dd> <dt> <h4 class="name" id="destroy"><span class="type-signature">&lt;inner> </span>destroy<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Destructor called when the object is destroyed.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-241">line 241</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="each"><span class="type-signature">&lt;inner> </span>each<span class="signature">(<span class="optional">query</span>, iterator, <span class="optional">thisobj</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Iterate over each item in the collection, or a subset that matches a query. This supports two signatures: <code>.each(query, function)</code> and <code>.each(function)</code>. If you pass in a query, only the items that match the query are iterated over.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A query to evaluate</p></td> </tr> <tr> <td class="name"><code>iterator</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="description last"><p>Function to execute against each item in the collection</p></td> </tr> <tr> <td class="name"><code>thisobj</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The value of <code>this</code></p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-67">line 67</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="flatten"><span class="type-signature">&lt;inner> </span>flatten<span class="signature">(<span class="optional">query</span>, iterator,, <span class="optional">thisobj</span>)</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Flattens a nested array (the nesting can be to any depth). If isShallow is truthy, array will only be flattened a single level. If callback is passed, each element of array is passed through a callback before flattening.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A query to evaluate . If you pass in a query, only the items that match the query are iterated over.</p></td> </tr> <tr> <td class="name"><code>iterator,</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>thisobj</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The value of <code>this</code></p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-338">line 338</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <dt> <h4 class="name" id="groupBy"><span class="type-signature">&lt;inner> </span>groupBy<span class="signature">(<span class="optional">query</span>, iterator, <span class="optional">thisobj</span>)</span><span class="type-signature"> &rarr; {object}</span></h4> </dt> <dd> <div class="description"> <p>Creates an object composed of keys returned from running each element of the collection through the callback. The corresponding value of each key is an array of elements passed to callback that returned the key. The callback is invoked with three arguments: (value, index|key, collection).</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A query to evaluate . If you pass in a query, only the items that match the query are iterated over.</p></td> </tr> <tr> <td class="name"><code>iterator</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>thisobj</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The value of <code>this</code></p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-157">line 157</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> </dd> </dl> </dd> <dt> <h4 class="name" id="index"><span class="type-signature">&lt;inner> </span>index<span class="signature">(key)</span><span class="type-signature"> &rarr; {*}</span></h4> </dt> <dd> <div class="description"> <p>Gets an items by its index</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The index to get</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-352">line 352</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">*</span> </dd> </dl> </dd> <dt> <h4 class="name" id="key"><span class="type-signature">&lt;inner> </span>key<span class="signature">(key)</span><span class="type-signature"> &rarr; {*}</span></h4> </dt> <dd> <div class="description"> <p>Get a record by key</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last"><p>The key of the record to get</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-257">line 257</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">*</span> </dd> </dl> </dd> <dt> <h4 class="name" id="map"><span class="type-signature">&lt;inner> </span>map<span class="signature">(<span class="optional">query</span>, iterator, <span class="optional">thisobj</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Maps the contents to an array by iterating over it and transforming it. You supply the iterator. Supports two signatures: <code>.map(query, function)</code> and <code>.map(function)</code>. If you pass in a query, only the items that match the query are iterated over.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A query to evaluate</p></td> </tr> <tr> <td class="name"><code>iterator</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="description last"><p>Function to execute against each item in the collection</p></td> </tr> <tr> <td class="name"><code>thisobj</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The value of <code>this</code></p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-99">line 99</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="max"><span class="type-signature">&lt;inner> </span>max<span class="signature">(<span class="optional">query</span>, iterator, <span class="optional">thisobj</span>)</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Retrieves the maximum value of an array. If callback is passed, it will be executed for each value in the array to generate the criterion by which the value is ranked.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A query to evaluate . If you pass in a query, only the items that match the query are iterated over.</p></td> </tr> <tr> <td class="name"><code>iterator</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>thisobj</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The value of <code>this</code></p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-211">line 211</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <dt> <h4 class="name" id="min"><span class="type-signature">&lt;inner> </span>min<span class="signature">(<span class="optional">query</span>, iterator, <span class="optional">thisobj</span>)</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Retrieves the minimum value of an array. If callback is passed, it will be executed for each value in the array to generate the criterion by which the value is ranked.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A query to evaluate . If you pass in a query, only the items that match the query are iterated over.</p></td> </tr> <tr> <td class="name"><code>iterator</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>thisobj</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The value of <code>this</code></p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-229">line 229</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <dt> <h4 class="name" id="pluck"><span class="type-signature">&lt;inner> </span>pluck<span class="signature">(<span class="optional">query</span>, property)</span><span class="type-signature"> &rarr; {*}</span></h4> </dt> <dd> <div class="description"> <p>Reduce the collection to a single value. Supports two signatures: <code>.pluck(query, function)</code> and <code>.pluck(function)</code></p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The query to evaluate. If you pass in a query, only the items that match the query are iterated over.</p></td> </tr> <tr> <td class="name"><code>property</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last"><p>The property that will be 'plucked' from the contents of the collection</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-174">line 174</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">*</span> </dd> </dl> </dd> <dt> <h4 class="name" id="push"><span class="type-signature">&lt;inner> </span>push<span class="signature">(item)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Add an item to the top of the list. This is identical to <code>add</code>, but is provided for stack semantics</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>item</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last"><p>The item to add to the collection. Only one item at a time can be added</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-310">line 310</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="reduce"><span class="type-signature">&lt;inner> </span>reduce<span class="signature">(<span class="optional">query</span>, iterator, <span class="optional">accumulator</span>, <span class="optional">thisobj</span>)</span><span class="type-signature"> &rarr; {*}</span></h4> </dt> <dd> <div class="description"> <p>Reduces a collection to a value which is the accumulated result of running each element in the collection through the callback, where each successive callback execution consumes the return value of the previous execution. If accumulator is not passed, the first element of the collection will be used as the initial accumulator value. are iterated over.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A query to evaluate</p></td> </tr> <tr> <td class="name"><code>iterator</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes">