Regenerated api docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 0fce93b · Browse files · 1 file·+142 added−362 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+142 added−362 removed
- other:+142 added−362 removed
Provenance
- Commit
69baa6e- Tree
1e571f1- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
0fce93b
1 file changed+142 added−362 removed
modified:docs/api.html+142 added-362 removed
1 <html>2 <head>3 <title>Express</title>4+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>5 <style>body {6 margin: 0;7 padding: 0;8 font: 14px/1.5 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;12 unmodified lines21 h1, h2, h3 {22 margin: 0;23 padding: 0;24 }24-ul#menu {25- opacity: 0;26- position: fixed;27- top: 0;28- right: 0;29- list-style: none;30- margin: 0;31- padding: 10px 2px;32- text-align: right;33- background: rgba(255,255,255,0.7);34- -webkit-box-shadow: -1px 2px 2px rgba(0,0,0,0.3);35- -moz-box-shadow: -1px 2px 2px rgba(0,0,0,0.3);36- -webkit-border-bottom-left-radius: 5px;37- -moz-border-bottom-left-radius: 5px;38- -webkit-transition-properties: opacity;39- -webkit-transition-duration: 0.6s;40-}41-ul#menu:hover {42- opacity: 1;43-}44-ul#menu li {45- padding: 2px 10px;46- border-bottom: 1px solid #eee;47-}48-ul#menu li:hover {49- background: rgba(0,0,0,0.03);50-}51-ul#menu li:last-child {52- border-bottom: none;53-}54-ul#menu li a {55- text-decoration: none;56- font-size: 12px;57- color: rgba(0,0,0,0.5);58-}59-ul#menu li a strong {60- font-weight: normal;61- color: #252519;62-}25 table#source {26 width: 100%;27 border-collapse: collapse;28 }25 unmodified lines54 }55 table#source tr.filename h2 {56 margin: 0;57 padding: 0;58+ cursor: pointer;59 }60 table#source tr.code h1,61 table#source tr.code h2,62 table#source tr.code h3 {22 unmodified lines85 table#source tr.code td:first-child pre {86 padding: 20px;87 }88 #ribbon {126- position: absolute;89+ position: fixed;90 top: 0;91 right: 0;92 }93 code .string { color: #219161; }1 unmodified line95 code .keyword { color: #954121; }96 code .number { color: #19469D; }97 code .comment { color: #bbb; }98 code .this { color: #19469D; }</style>99+ <script>100+ $(function(){101+ $('tr.code').hide();102+ $('tr.filename').toggle(function(){103+ $(this).nextUntil('.filename').fadeIn();104+ }, function(){105+ $(this).nextUntil('.filename').fadeOut();106+ });107+ });108+ </script>109 </head>110 <body>138-<ul id="menu"><li><a href="#lib/express/index.js">lib/express/<strong>index</strong></a></li>139-<li><a href="#lib/express/request.js">lib/express/<strong>request</strong></a></li>140-<li><a href="#lib/express/response.js">lib/express/<strong>response</strong></a></li>141-<li><a href="#lib/express/server.js">lib/express/<strong>server</strong></a></li>142-<li><a href="#lib/express/utils.js">lib/express/<strong>utils</strong></a></li>143-<li><a href="#lib/express/view.js">lib/express/<strong>view</strong></a></li></ul><table id="source"><tbody><tr><td><h1>Express</h1><p>High performance web framework for <a href="http://nodejs.org">node</a>.</p></td><td></td></tr><tr class="filename"><td><h2 id="lib/express/index.js">index</h2></td><td>lib/express/index.js</td></tr><tr class="code">111+<table id="source"><tbody><tr><td><h1>Express</h1><p>High performance web framework for <a href="http://nodejs.org">node</a>.</p></td><td></td></tr><tr class="filename"><td><h2 id="lib/express/index.js"><a href="#">index</a></h2></td><td>lib/express/index.js</td></tr><tr class="code">112 <td class="docs">145-<p>Framework version.</p>113+<p>Framework version.114+ </p>115 </td>116 <td class="code">117 <pre><code><span class="variable">exports</span>.<span class="variable">version</span> = <span class="string">'0.14.0'</span>;</code></pre>118 </td>119 </tr>120 <tr class="code">121 <td class="docs">153-<p>Module dependencies.</p>122+<p>Module dependencies.123+ </p>124 </td>125 <td class="code">126 <pre><code><span class="keyword">var</span> <span class="class">Server</span> = <span class="variable">require</span>(<span class="string">'./server'</span>);</code></pre>127 </td>3 unmodified lines131 <p>Shortcut for <code>new Server(...)</code>.</p>132 133 <h2></h2>134 165-<ul>166-<li><p><strong>param</strong>: <em>Function</em> …</p></li>167-<li><p><strong>return</strong>: <em>Server</em></p></li>168-<li><p><strong>api</strong>: <em>public</em></p></li>169-</ul>170-135+<ul><li><p><strong>param</strong>: <em>Function</em> ...</p></li><li><p><strong>return</strong>: <em>Server</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>136 </td>137 <td class="code">138 <pre><code><span class="variable">exports</span>.<span class="variable">createServer</span> = <span class="keyword">function</span>(){139 <span class="keyword">return</span> <span class="keyword">new</span> <span class="class">Server</span>(<span class="class">Array</span>.<span class="variable">prototype</span>.<span class="variable">slice</span>.<span class="variable">call</span>(<span class="variable">arguments</span>));1 unmodified line141 </td>142 </tr>143 <tr class="code">144 <td class="docs">180-<p>View extensions.</p>145+<p>View extensions.146+ </p>147 </td>148 <td class="code">149 <pre><code><span class="variable">require</span>(<span class="string">'./view'</span>);150 <span class="variable">require</span>(<span class="string">'./request'</span>);151 <span class="variable">require</span>(<span class="string">'./response'</span>);152 </code></pre>153 </td>188-</tr><tr class="filename"><td><h2 id="lib/express/request.js">request</h2></td><td>lib/express/request.js</td></tr><tr class="code">154+</tr><tr class="filename"><td><h2 id="lib/express/utils.js"><a href="#">utils</a></h2></td><td>lib/express/utils.js</td></tr><tr class="code">155 <td class="docs">190-<p>Module dependencies.</p>156+<p>Parse mini markdown implementation.157+The following conversions are supported,158+primarily for the "flash" middleware:</p>159+160+<p> <em>foo</em> or <em>foo</em> become <em>foo</em>161+ <strong>foo</strong> or <strong>foo</strong> become <strong>foo</strong>162+ <a href="B">A</a> becomes <a href="B">A</a></p>163+164+<h2></h2>165+166+<ul><li><p><strong>param</strong>: <em>String</em> str</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>167 </td>168 <td class="code">169+<pre><code><span class="variable">exports</span>.<span class="variable">miniMarkdown</span> = <span class="keyword">function</span>(<span class="variable">str</span>){170+ <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">str</span>)171+ .<span class="variable">replace</span>(<span class="regexp">/(__|\*\*)(.*?)\1/g</span>, <span class="string">'<strong>$2</strong>'</span>)172+ .<span class="variable">replace</span>(<span class="regexp">/(_|\*)(.*?)\1/g</span>, <span class="string">'<em>$2</em>'</span>)173+ .<span class="variable">replace</span>(<span class="regexp">/\[([^\]]+)\]\(([^)]+)\)/g</span>, <span class="string">'<a href="$2">$1</a>'</span>);174+};</code></pre>175+</td>176+</tr>177+<tr class="code">178+<td class="docs">179+<p>Escape special characters in the given string of html.</p>180+181+<h2></h2>182+183+<ul><li><p><strong>param</strong>: <em>String</em> html</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>184+</td>185+<td class="code">186+<pre><code><span class="variable">exports</span>.<span class="variable">htmlEscape</span> = <span class="keyword">function</span>(<span class="variable">html</span>) {187+ <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">html</span>)188+ .<span class="variable">replace</span>(<span class="regexp">/&/g</span>, <span class="string">'&'</span>)189+ .<span class="variable">replace</span>(<span class="regexp">/"/g</span>, <span class="string">'"'</span>)190+ .<span class="variable">replace</span>(<span class="regexp">/</g</span>, <span class="string">'<'</span>)191+ .<span class="variable">replace</span>(<span class="regexp">/>/g</span>, <span class="string">'>'</span>);192+};</code></pre>193+</td>194+</tr><tr class="filename"><td><h2 id="lib/express/request.js"><a href="#">request</a></h2></td><td>lib/express/request.js</td></tr><tr class="code">195+<td class="docs">196+<p>Module dependencies.197+ </p>198+</td>199+<td class="code">200 <pre><code><span class="keyword">var</span> <span class="variable">http</span> = <span class="variable">require</span>(<span class="string">'http'</span>),201 <span class="variable">utils</span> = <span class="variable">require</span>(<span class="string">'./utils'</span>),202 <span class="variable">mime</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>).<span class="variable">mime</span>;</code></pre>203 </td>13 unmodified lines217 req.header('Accept');218 // => undefined219 220 req.header('Accept', 'text/html');214-// => "text/html"215-</code></pre>221+// => "text/html"</code></pre>222 223 <h2></h2>224 219-<ul>220-<li><p><strong>param</strong>: <em>String</em> name</p></li>221-<li><p><strong>param</strong>: <em>String</em> defaultValue</p></li>222-<li><p><strong>return</strong>: <em>String</em></p></li>223-<li><p><strong>api</strong>: <em>public</em></p></li>224-</ul>225-225+<ul><li><p><strong>param</strong>: <em>String</em> name</p></li><li><p><strong>param</strong>: <em>String</em> defaultValue</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>226 </td>227 <td class="code">228 <pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">header</span> = <span class="keyword">function</span>(<span class="variable">name</span>, <span class="variable">defaultValue</span>){229 <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">headers</span>[<span class="variable">name</span>.<span class="variable">toLowerCase</span>()] || <span class="variable">defaultValue</span>;5 unmodified lines235 <p>Check if the <em>Accept</em> header is present, and includes the given <code>type</code>.</p>236 237 <p>When the <em>Accept</em> header is not present <code>true</code> is returned. Otherwise238 the given <code>type</code> is matched by an exact match, and then subtypes. You239-may pass the subtype such as “html” which is then converted internally240-to “text/html” using the mime lookup table.</p>239+may pass the subtype such as "html" which is then converted internally240+to "text/html" using the mime lookup table.</p>241 242 <h2>Examples</h2>243 244 <pre><code>// Accept: text/html8 unmodified lines253 // => true254 255 req.accepts('image/png');256 req.accepts('png');257-// => false258-</code></pre>257+// => false</code></pre>258 259 <h2></h2>260 262-<ul>263-<li><p><strong>param</strong>: <em>String</em> type</p></li>264-<li><p><strong>return</strong>: <em>Boolean</em></p></li>265-<li><p><strong>api</strong>: <em>public</em></p></li>266-</ul>267-261+<ul><li><p><strong>param</strong>: <em>String</em> type</p></li><li><p><strong>return</strong>: <em>Boolean</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>262 </td>263 <td class="code">264 <pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">accepts</span> = <span class="keyword">function</span>(<span class="variable">type</span>){265 <span class="keyword">var</span> <span class="variable">accept</span> = <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Accept'</span>);1 unmodified line267 </td>268 </tr>269 <tr class="code">270 <td class="docs">277-<p>‘) {</p>278-279-<pre><code> return true;280-} else if (type) {281- // Allow "html" vs "text/html" etc282- if (type.indexOf('/') < 0) {283- type = mime.types['.' + type];284- }285- // Check if we have a direct match286- if (accept.indexOf(type) >= 0) {271+<p>') {272 return true;273+ } else if (type) {274+ // Allow "html" vs "text/html" etc275+ if (type.indexOf('/') < 0) {276+ type = mime.types['.' + type];277+ }278+ // Check if we have a direct match279+ if (accept.indexOf(type) >= 0) {280+ return true;288- // Check if we have type/*281+ // Check if we have type/<em>282+ } else {283+ type = type.split('/')[0] + '/</em>';284+ return accept.indexOf(type) >= 0;285+ }286 } else {290- type = type.split('/')[0] + '/*';291- return accept.indexOf(type) >= 0;287+ return false;288 }293-} else {294- return false;295-}296-</code></pre>289+};</p>290 298-<p>};</p>299-291 <p>/**292 Return the value of param <code>name</code> when present.</p>293 303-<ul>304-<li>Checks route placeholders, ex: <em>/user/:id</em></li>305-<li>Checks query string params, ex: ?id=12</li>306-<li>Checks urlencoded body params, ex: id=12</li>307-</ul>294+<ul><li>Checks route placeholders, ex: <em>/user/:id</em></li><li>Checks query string params, ex: ?id=12</li><li>Checks urlencoded body params, ex: id=12</li></ul>295 309-296 <p>To utilize urlencoded request bodies, <code>req.body</code>297 should be an object. This can be done by using298 the <code>connect.bodyDecoder</code> middleware.</p>299 300 <h2></h2>301 316-<ul>317-<li><p><strong>param</strong>: <em>String</em> name</p></li>318-<li><p><strong>return</strong>: <em>String</em></p></li>319-<li><p><strong>api</strong>: <em>public</em></p></li>320-</ul>321-302+<ul><li><p><strong>param</strong>: <em>String</em> name</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>303 </td>304 <td class="code">305 <pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">param</span> = <span class="keyword">function</span>(<span class="variable">name</span>){306 <span class="comment">// Route params like /user/:id</span>28 unmodified lines335 req.flash('info');336 // => []337 338 req.flash();358- // => { error: ['email delivery failed'], info: [] }359-</code></pre>339+ // => { error: ['email delivery failed'], info: [] }</code></pre>340 341 <h2></h2>342 363-<ul>364-<li><p><strong>param</strong>: <em>String</em> type</p></li>365-<li><p><strong>param</strong>: <em>String</em> msg</p></li>366-<li><p><strong>return</strong>: <em>Array | Object | Number</em></p></li>367-<li><p><strong>api</strong>: <em>public</em></p></li>368-</ul>369-343+<ul><li><p><strong>param</strong>: <em>String</em> type</p></li><li><p><strong>param</strong>: <em>String</em> msg</p></li><li><p><strong>return</strong>: <em>Array | Object | Number</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>344 </td>345 <td class="code">346 <pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">flash</span> = <span class="keyword">function</span>(<span class="variable">type</span>, <span class="variable">msg</span>){347 <span class="keyword">var</span> <span class="variable">msgs</span> = <span class="this">this</span>.<span class="variable">session</span>.<span class="variable">flash</span> = <span class="this">this</span>.<span class="variable">session</span>.<span class="variable">flash</span> || {};22 unmodified lines370 <p>Check if the request was an <em>XMLHttpRequest</em>.</p>371 372 <h2></h2>373 400-<ul>401-<li><p><strong>return</strong>: <em>Boolean</em></p></li>402-<li><p><strong>api</strong>: <em>public</em></p></li>403-</ul>404-374+<ul><li><p><strong>return</strong>: <em>Boolean</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>375 </td>376 <td class="code">377 <pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">__defineGetter__</span>(<span class="string">'isXMLHttpRequest'</span>, <span class="variable">isxhr</span>);378 <span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">__defineGetter__</span>(<span class="string">'xhr'</span>, <span class="variable">isxhr</span>);</code></pre>379 </td>410-</tr><tr class="filename"><td><h2 id="lib/express/response.js">response</h2></td><td>lib/express/response.js</td></tr><tr class="code">380+</tr><tr class="filename"><td><h2 id="lib/express/response.js"><a href="#">response</a></h2></td><td>lib/express/response.js</td></tr><tr class="code">381 <td class="docs">412-<p>Module dependencies.</p>382+<p>Module dependencies.383+ </p>384 </td>385 <td class="code">386 <pre><code><span class="keyword">var</span> <span class="variable">fs</span> = <span class="variable">require</span>(<span class="string">'fs'</span>),387 <span class="variable">http</span> = <span class="variable">require</span>(<span class="string">'http'</span>),13 unmodified lines401 res.send({ some: 'json' });402 res.send('<p>some html</p>');403 res.send('Sorry, cant find that', 404);404 res.send('text', { 'Content-Type': 'text/plain' }, 201);434-res.send(404);435-</code></pre>405+res.send(404);</code></pre>406 407 <h2></h2>408 439-<ul>440-<li><p><strong>param</strong>: <em>String | Object | Number | Buffer</em> body or status</p></li>441-<li><p><strong>param</strong>: <em>Object | Number</em> headers or status</p></li>442-<li><p><strong>param</strong>: <em>Number</em> status</p></li>443-<li><p><strong>return</strong>: <em>ServerResponse</em></p></li>444-<li><p><strong>api</strong>: <em>public</em></p></li>445-</ul>446-409+<ul><li><p><strong>param</strong>: <em>String | Object | Number | Buffer</em> body or status</p></li><li><p><strong>param</strong>: <em>Object | Number</em> headers or status</p></li><li><p><strong>param</strong>: <em>Number</em> status</p></li><li><p><strong>return</strong>: <em>ServerResponse</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>410 </td>411 <td class="code">412 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">send</span> = <span class="keyword">function</span>(<span class="variable">body</span>, <span class="variable">headers</span>, <span class="variable">status</span>){413 <span class="comment">// Allow status as second arg</span>55 unmodified lines469 response header, and responds with 404 / 500 appropriately.</p>470 471 <h2></h2>472 510-<ul>511-<li><p><strong>param</strong>: <em>String</em> file</p></li>512-<li><p><strong>api</strong>: <em>public</em></p></li>513-</ul>514-473+<ul><li><p><strong>param</strong>: <em>String</em> file</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>474 </td>475 <td class="code">476 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">sendfile</span> = <span class="keyword">function</span>(<span class="variable">file</span>){477 <span class="keyword">var</span> <span class="variable">self</span> = <span class="this">this</span>;17 unmodified lines495 <h2>Examples</h2>496 497 <pre><code>var filename = 'path/to/image.png';498 res.contentType(filename);540-// res.headers['Content-Type'] is now "image/png"541-</code></pre>499+// res.headers['Content-Type'] is now "image/png"</code></pre>500 501 <h2></h2>502 545-<ul>546-<li><p><strong>param</strong>: <em>String</em> type</p></li>547-<li><p><strong>return</strong>: <em>String</em> the resolved mime type</p></li>548-<li><p><strong>api</strong>: <em>public</em></p></li>549-</ul>550-503+<ul><li><p><strong>param</strong>: <em>String</em> type</p></li><li><p><strong>return</strong>: <em>String</em> the resolved mime type</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>504 </td>505 <td class="code">506 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">contentType</span> = <span class="keyword">function</span>(<span class="variable">type</span>){507 <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Content-Type'</span>, <span class="variable">mime</span>.<span class="variable">type</span>(<span class="variable">type</span>));5 unmodified lines513 <p>Set <em>Content-Disposition</em> header to <em>attachment</em> with optional <code>filename</code>.</p>514 515 <h2></h2>516 564-<ul>565-<li><p><strong>param</strong>: <em>String</em> filename</p></li>566-<li><p><strong>return</strong>: <em>ServerResponse</em></p></li>567-<li><p><strong>api</strong>: <em>public</em></p></li>568-</ul>569-517+<ul><li><p><strong>param</strong>: <em>String</em> filename</p></li><li><p><strong>return</strong>: <em>ServerResponse</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>518 </td>519 <td class="code">520 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">attachment</span> = <span class="keyword">function</span>(<span class="variable">filename</span>){521 <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Content-Disposition'</span>, <span class="variable">filename</span>8 unmodified lines530 <p>Transfer the given <code>file</code> with optional <code>filename</code> as an attachment.</p>531 532 <h2></h2>533 586-<ul>587-<li><p><strong>param</strong>: <em>String</em> file</p></li>588-<li><p><strong>param</strong>: <em>String</em> filename</p></li>589-<li><p><strong>return</strong>: <em>Type</em></p></li>590-<li><p><strong>api</strong>: <em>public</em></p></li>591-</ul>592-534+<ul><li><p><strong>param</strong>: <em>String</em> file</p></li><li><p><strong>param</strong>: <em>String</em> filename</p></li><li><p><strong>return</strong>: <em>Type</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>535 </td>536 <td class="code">537 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">download</span> = <span class="keyword">function</span>(<span class="variable">file</span>, <span class="variable">filename</span>){538 <span class="this">this</span>.<span class="variable">attachment</span>(<span class="variable">filename</span> || <span class="variable">file</span>).<span class="variable">sendfile</span>(<span class="variable">file</span>);5 unmodified lines544 <p>Set or get response header <code>name</code> with optional <code>val</code>.</p>545 546 <h2></h2>547 606-<ul>607-<li><p><strong>param</strong>: <em>String</em> name</p></li>608-<li><p><strong>param</strong>: <em>String</em> val</p></li>609-<li><p><strong>return</strong>: <em>String</em></p></li>610-<li><p><strong>api</strong>: <em>public</em></p></li>611-</ul>612-548+<ul><li><p><strong>param</strong>: <em>String</em> name</p></li><li><p><strong>param</strong>: <em>String</em> val</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>549 </td>550 <td class="code">551 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">header</span> = <span class="keyword">function</span>(<span class="variable">name</span>, <span class="variable">val</span>){552 <span class="keyword">return</span> <span class="variable">val</span> === <span class="variable">undefined</span>7 unmodified lines560 <p>Redirect to the given <code>url</code> with optional response <code>status</code>561 defauling to 302.</p>562 563 <p>The given <code>url</code> can also be the name of a mapped url, for628-example by default express supports “back” which redirects629-to the <em>Referrer</em> or <em>Referer</em> headers or the application’s630-“home” setting. Express also supports “home” out of the box,564+example by default express supports "back" which redirects565+to the <em>Referrer</em> or <em>Referer</em> headers or the application's566+"home" setting. Express also supports "home" out of the box,567 which can be set via <code>app.set('home', '/blog');</code>, and defaults632-to ‘/’.</p>568+to '/'.</p>569 570 <h2>Redirect Mapping</h2>571 572 <p> To extend the redirect mapping capabilities that Express provides,573 we may use the <code>app.redirect()</code> method:</p>574 639-<pre><code>app.redirect('google', 'http://google.com');640-</code></pre>575+<pre><code>app.redirect('google', 'http://google.com');</code></pre>576 577 <p> Now in a route we may call:</p>578 644-<pre><code>res.redirect('google');645-</code></pre>579+<pre><code>res.redirect('google');</code></pre>580 581 <p> We may also map dynamic redirects:</p>582 583 <pre><code> app.redirect('comments', function(req, res, params){584 return '/post/' + params.id + '/comments';651- });652-</code></pre>585+ });</code></pre>586 587 <p> So now we may do the following, and the redirect will dynamically adjust to588 the context of the request. If we called this route with <em>GET /post/12</em> our589 redirect <em>Location</em> would be <em>/post/12/comments</em>.</p>590 591 <pre><code> app.get('/post/:id', function(req, res){592 res.redirect('comments');660- });661-</code></pre>593+ });</code></pre>594 595 <h2></h2>596 665-<ul>666-<li><p><strong>param</strong>: <em>String</em> url</p></li>667-<li><p><strong>param</strong>: <em>Number</em> code</p></li>668-<li><p><strong>api</strong>: <em>public</em></p></li>669-</ul>670-597+<ul><li><p><strong>param</strong>: <em>String</em> url</p></li><li><p><strong>param</strong>: <em>Number</em> code</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>598 </td>599 <td class="code">600 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">redirect</span> = <span class="keyword">function</span>(<span class="variable">url</span>, <span class="variable">status</span>){601 <span class="keyword">var</span> <span class="variable">basePath</span> = <span class="this">this</span>.<span class="variable">app</span>.<span class="variable">set</span>(<span class="string">'home'</span>) || <span class="string">'/'</span>;17 unmodified lines619 <span class="this">this</span>.<span class="variable">end</span>();620 };621 </code></pre>622 </td>696-</tr><tr class="filename"><td><h2 id="lib/express/server.js">server</h2></td><td>lib/express/server.js</td></tr><tr class="code">623+</tr><tr class="filename"><td><h2 id="lib/express/server.js"><a href="#">server</a></h2></td><td>lib/express/server.js</td></tr><tr class="code">624 <td class="docs">698-<p>Module dependencies.</p>625+<p>Module dependencies.626+ </p>627 </td>628 <td class="code">629 <pre><code><span class="keyword">var</span> <span class="variable">sys</span> = <span class="variable">require</span>(<span class="string">'sys'</span>),630 <span class="variable">url</span> = <span class="variable">require</span>(<span class="string">'url'</span>),8 unmodified lines639 <p>Initialize a new <code>Server</code> with optional <code>middleware</code>.</p>640 641 <h2></h2>642 715-<ul>716-<li><p><strong>param</strong>: <em>Array</em> middleware</p></li>717-<li><p><strong>api</strong>: <em>public</em></p></li>718-</ul>719-643+<ul><li><p><strong>param</strong>: <em>Array</em> middleware</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>644 </td>645 <td class="code">646 <pre><code><span class="keyword">var</span> <span class="class">Server</span> = <span class="variable">exports</span> = <span class="variable">module</span>.<span class="variable">exports</span> = <span class="keyword">function</span> <span class="class">Server</span>(<span class="variable">middleware</span>){647 <span class="keyword">var</span> <span class="variable">self</span> = <span class="this">this</span>;27 unmodified lines675 </td>676 </tr>677 <tr class="code">678 <td class="docs">755-<p>Inherit from <code>connect.Server</code>.</p>679+<p>Inherit from <code>connect.Server</code>.680+ </p>681 </td>682 <td class="code">683 <pre><code><span class="variable">sys</span>.<span class="variable">inherits</span>(<span class="class">Server</span>, <span class="variable">connect</span>.<span class="class">Server</span>);</code></pre>684 </td>3 unmodified lines688 <p>Listen on the given <code>port</code> after running configuration blocks.</p>689 690 <h2></h2>691 767-<ul>768-<li><p><strong>param</strong>: <em>Number</em> port</p></li>769-<li><p><strong>api</strong>: <em>public</em></p></li>770-</ul>771-692+<ul><li><p><strong>param</strong>: <em>Number</em> port</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>693 </td>694 <td class="code">695 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">listen</span> = <span class="keyword">function</span>(<span class="variable">port</span>){696 <span class="this">this</span>.<span class="variable">set</span>(<span class="string">'env'</span>, <span class="variable">process</span>.<span class="variable">env</span>.<span class="class">EXPRESS_ENV</span> || <span class="variable">process</span>.<span class="variable">connectEnv</span>.<span class="variable">name</span>);3 unmodified lines700 <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">set</span>(<span class="string">'reload views'</span>)) {701 <span class="variable">view</span>.<span class="variable">watcher</span>.<span class="variable">call</span>(<span class="this">this</span>, <span class="this">this</span>.<span class="variable">set</span>(<span class="string">'reload views'</span>));702 }703 783- <span class="comment">// Custom exception handler</span>784- <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">errorHandler</span>) {785- <span class="this">this</span>.<span class="variable">use</span>(<span class="string">'/'</span>, <span class="this">this</span>.<span class="variable">errorHandler</span>);786- }787- 704 <span class="variable">connect</span>.<span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">listen</span>.<span class="variable">call</span>(<span class="this">this</span>, <span class="variable">port</span>);705 };</code></pre>706 </td>707 </tr>2 unmodified lines710 <p>Run config callbacks for the given environment(s);</p>711 712 <h2></h2>713 798-<ul>799-<li><p><strong>param</strong>: <em>String</em> env …</p></li>800-<li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>801-<li><p><strong>api</strong>: <em>public</em></p></li>802-</ul>803-714+<ul><li><p><strong>param</strong>: <em>String</em> env ...</p></li><li><p><strong>return</strong>: <em>Server</em> for chaining</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>715 </td>716 <td class="code">717 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">runConfig</span> = <span class="keyword">function</span>(){718 <span class="keyword">for</span> (<span class="keyword">var</span> <span class="variable">i</span> = <span class="number integer">0</span>, <span class="variable">len</span> = <span class="variable">arguments</span>.<span class="variable">length</span>; <span class="variable">i</span> &<span class="variable">lt</span>; <span class="variable">len</span>; ++<span class="variable">i</span>) {14 unmodified lines733 <p>Assign a custom exception handler callback <code>fn</code>.</p>734 735 <h2></h2>736 826-<ul>827-<li><p><strong>param</strong>: <em>Function</em> fn</p></li>828-<li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>829-<li><p><strong>api</strong>: <em>public</em></p></li>830-</ul>831-737+<ul><li><p><strong>param</strong>: <em>Function</em> fn</p></li><li><p><strong>return</strong>: <em>Server</em> for chaining</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>738 </td>739 <td class="code">740 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">error</span> = <span class="keyword">function</span>(<span class="variable">fn</span>){835- <span class="this">this</span>.<span class="variable">errorHandler</span> = <span class="variable">fn</span>;741+ <span class="this">this</span>.<span class="variable">use</span>(<span class="string">'/'</span>, <span class="keyword">function</span>(<span class="variable">err</span>, <span class="variable">req</span>, <span class="variable">res</span>, <span class="variable">next</span>){742+ <span class="variable">fn</span>.<span class="variable">apply</span>(<span class="this">this</span>, <span class="variable">arguments</span>);743+ });744 <span class="keyword">return</span> <span class="this">this</span>;745 };</code></pre>746 </td>747 </tr>748 <tr class="code">749 <td class="docs">842-<p>Assign <code>setting</code> to <code>val</code>, or return <code>setting</code>’s value.</p>750+<p>Assign <code>setting</code> to <code>val</code>, or return <code>setting</code>'s value.</p>751 752 <h2></h2>753 846-<ul>847-<li><p><strong>param</strong>: <em>String</em> setting</p></li>848-<li><p><strong>param</strong>: <em>String</em> val</p></li>849-<li><p><strong>return</strong>: <em>Server | Mixed</em> for chaining, or the setting value</p></li>850-<li><p><strong>api</strong>: <em>public</em></p></li>851-</ul>852-754+<ul><li><p><strong>param</strong>: <em>String</em> setting</p></li><li><p><strong>param</strong>: <em>String</em> val</p></li><li><p><strong>return</strong>: <em>Server | Mixed</em> for chaining, or the setting value</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>755 </td>756 <td class="code">757 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">set</span> = <span class="keyword">function</span>(<span class="variable">setting</span>, <span class="variable">val</span>){758 <span class="keyword">if</span> (<span class="variable">val</span> === <span class="variable">undefined</span>) {10 unmodified lines769 <p>Enable <code>setting</code>.</p>770 771 <h2></h2>772 871-<ul>872-<li><p><strong>param</strong>: <em>String</em> setting</p></li>873-<li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>874-<li><p><strong>api</strong>: <em>public</em></p></li>875-</ul>876-773+<ul><li><p><strong>param</strong>: <em>String</em> setting</p></li><li><p><strong>return</strong>: <em>Server</em> for chaining</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>774 </td>775 <td class="code">776 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">enable</span> = <span class="keyword">function</span>(<span class="variable">setting</span>){777 <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">set</span>(<span class="variable">setting</span>, <span class="variable">true</span>);5 unmodified lines783 <p>Disable <code>setting</code>.</p>784 785 <h2></h2>786 890-<ul>891-<li><p><strong>param</strong>: <em>String</em> setting</p></li>892-<li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>893-<li><p><strong>api</strong>: <em>public</em></p></li>894-</ul>895-787+<ul><li><p><strong>param</strong>: <em>String</em> setting</p></li><li><p><strong>return</strong>: <em>Server</em> for chaining</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>788 </td>789 <td class="code">790 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">disable</span> = <span class="keyword">function</span>(<span class="variable">setting</span>){791 <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">set</span>(<span class="variable">setting</span>, <span class="variable">false</span>);5 unmodified lines797 <p>Redirect <code>key</code> to <code>url</code>.</p>798 799 <h2></h2>800 909-<ul>910-<li><p><strong>param</strong>: <em>String</em> key</p></li>911-<li><p><strong>param</strong>: <em>String</em> url</p></li>912-<li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>913-<li><p><strong>api</strong>: <em>public</em></p></li>914-</ul>915-801+<ul><li><p><strong>param</strong>: <em>String</em> key</p></li><li><p><strong>param</strong>: <em>String</em> url</p></li><li><p><strong>return</strong>: <em>Server</em> for chaining</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>802 </td>803 <td class="code">804 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">redirect</span> = <span class="keyword">function</span>(<span class="variable">key</span>, <span class="variable">url</span>){805 <span class="this">this</span>.<span class="variable">redirects</span>[<span class="variable">key</span>] = <span class="variable">url</span>;6 unmodified lines812 <p>Disable <code>setting</code>.</p>813 814 <h2></h2>815 930-<ul>931-<li><p><strong>param</strong>: <em>String</em> setting</p></li>932-<li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>933-<li><p><strong>api</strong>: <em>public</em></p></li>934-</ul>935-816+<ul><li><p><strong>param</strong>: <em>String</em> setting</p></li><li><p><strong>return</strong>: <em>Server</em> for chaining</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>817 </td>818 <td class="code">819 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">configure</span> = <span class="keyword">function</span>(<span class="variable">env</span>, <span class="variable">fn</span>){820 <span class="keyword">if</span> (<span class="keyword">typeof</span> <span class="variable">env</span> === <span class="string">'function'</span>) <span class="variable">fn</span> = <span class="variable">env</span>, <span class="variable">env</span> = <span class="string">'any'</span>;11 unmodified lines832 <span class="keyword">return</span> <span class="variable">arguments</span>.<span class="variable">callee</span>;833 })(<span class="string">'get'</span>)(<span class="string">'post'</span>)(<span class="string">'put'</span>)(<span class="string">'del'</span>);834 </code></pre>835 </td>955-</tr><tr class="filename"><td><h2 id="lib/express/utils.js">utils</h2></td><td>lib/express/utils.js</td></tr><tr class="code">836+</tr><tr class="filename"><td><h2 id="lib/express/view.js"><a href="#">view</a></h2></td><td>lib/express/view.js</td></tr><tr class="code">837 <td class="docs">957-<p>Parse mini markdown implementation.958-The following conversions are supported,959-primarily for the “flash” middleware:</p>960-961-<p> <em>foo</em> or <em>foo</em> become <em>foo</em>962- <strong>foo</strong> or <strong>foo</strong> become <strong>foo</strong>963- <a href="B">A</a> becomes <a href="B">A</a></p>964-965-<h2></h2>966-967-<ul>968-<li><p><strong>param</strong>: <em>String</em> str</p></li>969-<li><p><strong>return</strong>: <em>String</em></p></li>970-<li><p><strong>api</strong>: <em>public</em></p></li>971-</ul>972-838+<p>Module dependencies.839+ </p>840 </td>841 <td class="code">975-<pre><code><span class="variable">exports</span>.<span class="variable">miniMarkdown</span> = <span class="keyword">function</span>(<span class="variable">str</span>){976- <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">str</span>)977- .<span class="variable">replace</span>(<span class="regexp">/(__|\*\*)(.*?)\1/g</span>, <span class="string">'<strong>$2</strong>'</span>)978- .<span class="variable">replace</span>(<span class="regexp">/(_|\*)(.*?)\1/g</span>, <span class="string">'<em>$2</em>'</span>)979- .<span class="variable">replace</span>(<span class="regexp">/\[([^\]]+)\]\(([^)]+)\)/g</span>, <span class="string">'<a href="$2">$1</a>'</span>);980-};</code></pre>981-</td>982-</tr>983-<tr class="code">984-<td class="docs">985-<p>Escape special characters in the given string of html.</p>986-987-<h2></h2>988-989-<ul>990-<li><p><strong>param</strong>: <em>String</em> html</p></li>991-<li><p><strong>return</strong>: <em>String</em></p></li>992-<li><p><strong>api</strong>: <em>public</em></p></li>993-</ul>994-995-</td>996-<td class="code">997-<pre><code><span class="variable">exports</span>.<span class="variable">htmlEscape</span> = <span class="keyword">function</span>(<span class="variable">html</span>) {998- <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">html</span>)999- .<span class="variable">replace</span>(<span class="regexp">/&/g</span>, <span class="string">'&'</span>)1000- .<span class="variable">replace</span>(<span class="regexp">/"/g</span>, <span class="string">'"'</span>)1001- .<span class="variable">replace</span>(<span class="regexp">/</g</span>, <span class="string">'<'</span>)1002- .<span class="variable">replace</span>(<span class="regexp">/>/g</span>, <span class="string">'>'</span>);1003-};</code></pre>1004-</td>1005-</tr><tr class="filename"><td><h2 id="lib/express/view.js">view</h2></td><td>lib/express/view.js</td></tr><tr class="code">1006-<td class="docs">1007-<p>Module dependencies.</p>1008-</td>1009-<td class="code">842 <pre><code><span class="keyword">var</span> <span class="variable">extname</span> = <span class="variable">require</span>(<span class="string">'path'</span>).<span class="variable">extname</span>,843 <span class="variable">mime</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>).<span class="variable">mime</span>,844 <span class="variable">utils</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>),845 <span class="variable">http</span> = <span class="variable">require</span>(<span class="string">'http'</span>),6 unmodified lines852 <p>Cache supported template engine exports to853 increase performance by lowering the number854 of calls to <code>require()</code>.</p>855 1024-<ul>1025-<li><strong>type</strong>: <em>Object</em></li>1026-</ul>1027-856+<ul><li><p><strong>type</strong>: <em>Object</em></p></li></ul>857 </td>858 <td class="code">859 <pre><code><span class="keyword">var</span> <span class="variable">cache</span> = {};</code></pre>860 </td>1 unmodified line862 <tr class="code">863 <td class="docs">864 <p>Cache view contents to prevent I/O hits.</p>865 1037-<ul>1038-<li><strong>type</strong>: <em>Object</em></li>1039-</ul>1040-866+<ul><li><p><strong>type</strong>: <em>Object</em></p></li></ul>867 </td>868 <td class="code">869 <pre><code><span class="keyword">var</span> <span class="variable">viewCache</span> = {};</code></pre>870 </td>1 unmodified line872 <tr class="code">873 <td class="docs">874 <p>Clear the view cache.</p>875 1050-<ul>1051-<li><strong>api</strong>: <em>public</em></li>1052-</ul>1053-876+<ul><li><p><strong>api</strong>: <em>public</em></p></li></ul>877 </td>878 <td class="code">879 <pre><code><span class="variable">exports</span>.<span class="variable">clearCache</span> = <span class="keyword">function</span>(){880 <span class="variable">viewCache</span> = {};1 unmodified line882 </td>883 </tr>884 <tr class="code">885 <td class="docs">1063-<p>View helpers merged with each render’s locals.</p>886+<p>View helpers merged with each render's locals.</p>887 1065-<ul>1066-<li><strong>type</strong>: <em>Object</em></li>1067-</ul>1068-888+<ul><li><p><strong>type</strong>: <em>Object</em></p></li></ul>889 </td>890 <td class="code">891 <pre><code><span class="keyword">var</span> <span class="variable">helpers</span> = <span class="variable">exports</span>.<span class="variable">helpers</span> = {};</code></pre>892 </td>3 unmodified lines896 <p>Render <code>view</code> partial with the given <code>options</code>.</p>897 898 <h2>Options</h2>899 1080-<ul>1081-<li><p><code>as</code> Variable name for each <code>collection</code> value, defaults to the view name.</p>900+<ul><li><p><code>as</code> Variable name for each <code>collection</code> value, defaults to the view name.</p><ul><li>as: 'something' will add the <code>something</code> local variable</li><li>as: this will use the collection value as the template context</li><li><p>as: global will merge the collection value's properties with <code>locals</code></p></li></ul></li><li><p><code>collection</code> Array of objects, the name is derived from the view name itself. 901+For example <em>video.html</em> will have a object <em>video</em> available to it.</p></li></ul>902 1083-<ul>1084-<li>as: ‘something’ will add the <code>something</code> local variable</li>1085-<li>as: this will use the collection value as the template context</li>1086-<li>as: global will merge the collection value’s properties with <code>locals</code></li>1087-</ul>1088-</li>1089-<li><p><code>collection</code> Array of objects, the name is derived from the view name itself.1090-For example <em>video.html</em> will have a object <em>video</em> available to it.</p></li>1091-</ul>1092-1093-903 <h2></h2>904 1096-<ul>1097-<li><p><strong>param</strong>: <em>String</em> view</p></li>1098-<li><p><strong>param</strong>: <em>Object | Array</em> options or collection</p></li>1099-<li><p><strong>return</strong>: <em>String</em></p></li>1100-<li><p><strong>api</strong>: <em>public</em></p></li>1101-</ul>1102- %905+<ul><li><p><strong>param</strong>: <em>String</em> view</p></li><li><p><strong>param</strong>: <em>Object | Array</em> options or collection</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>906 </td>907 <td class="code">908 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">partial</span> = <span class="keyword">function</span>(<span class="variable">view</span>, <span class="variable">options</span>, <span class="variable">ext</span>){909 <span class="keyword">if</span> (<span class="variable">ext</span> &<span class="variable">amp</span>;&<span class="variable">amp</span>; <span class="variable">view</span>.<span class="variable">indexOf</span>(<span class="string">'.'</span>) &<span class="variable">lt</span>; <span class="number integer">0</span>) {40 unmodified lines950 951 <p> Most engines accept one or more of the following options,952 both <em>haml</em> and <em>jade</em> accept all:</p>953 1151-<ul>1152-<li><code>context</code> Template evaluation context (<code>this</code>)</li>1153-<li><code>locals</code> Object containing local variables</li>1154-<li><code>filename</code> Filename used for the <code>cache</code> option</li>1155-<li><code>cache</code> Cache intermediate JavaScript in memory</li>1156-<li><code>debug</code> Output debugging information</li>1157-</ul>954+<ul><li><code>context</code> Template evaluation context (<code>this</code>)</li><li><code>locals</code> Object containing local variables</li><li><code>filename</code> Filename used for the <code>cache</code> option</li><li><code>cache</code> Cache intermediate JavaScript in memory</li><li><code>debug</code> Output debugging information</li></ul>955 1159-956 <h2></h2>957 1162-<ul>1163-<li><p><strong>param</strong>: <em>String</em> view</p></li>1164-<li><p><strong>param</strong>: <em>Object</em> options</p></li>1165-<li><p><strong>param</strong>: <em>Function</em> fn</p></li>1166-<li><p><strong>api</strong>: <em>public</em></p></li>1167-</ul>1168- res.redirect('comments');1169- });1170-1171-## 1172- - **param**: _String_ url1173-1174- - **param**: _Number_ code1175-1176- - **api**: _public_1177-1178- 958+<ul><li><p><strong>param</strong>: <em>String</em> view</p></li><li><p><strong>param</strong>: <em>Object</em> options</p></li><li><p><strong>param</strong>: <em>Function</em> fn</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>959 </td>960 <td class="code">961 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">render</span> = <span class="keyword">function</span>(<span class="variable">view</span>, <span class="variable">options</span>, <span class="variable">fn</span>){962 <span class="variable">options</span> = <span class="variable">options</span> || {};93 unmodified lines