-
Notifications
You must be signed in to change notification settings - Fork 2
/
util.html
15 lines (13 loc) · 5.76 KB
/
util.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html> <html> <head> <title>util.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="barricane-db.html"> barricane-db.js </a> <a class="source" href="bdb-disk-manager.html"> bdb-disk-manager.js </a> <a class="source" href="db.html"> db.js </a> <a class="source" href="disk-io.html"> disk-io.js </a> <a class="source" href="old-barricane-db.html"> old-barricane-db.js </a> <a class="source" href="serialisation.html"> serialisation.js </a> <a class="source" href="swoj-codec.html"> swoj-codec.js </a> <a class="source" href="util.html"> util.js </a> <a class="source" href="app-test.html"> app-test.js </a> <a class="source" href="demo-model.html"> demo-model.js </a> <a class="source" href="hello-world-test.html"> hello-world-test.js </a> <a class="source" href="mock.html"> mock.js </a> <a class="source" href="old-disk-manager.html"> old-disk-manager.js </a> <a class="source" href="old-serialisation.html"> old-serialisation.js </a> <a class="source" href="swoj-codec-test.html"> swoj-codec-test.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> util.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p>Copyright (c) 2010 Barricane Technology Ltd., All Rights Reserved.
Released under the MIT open source licence.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>This is the obligatory dumping ground modules for all those bits which don't
fit well elsewhere.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">¶</a> </div> <p>This finds all the objects keys, which do not contain the magic marker.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">ownRealKeys</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">magic</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">accumulator</span> <span class="o">=</span> <span class="p">[];</span>
<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">propertyName</span> <span class="k">in</span> <span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">propertyName</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">propertyName</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">magic</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="o">!==</span> <span class="nx">magic</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">accumulator</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">propertyName</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nx">accumulator</span><span class="p">;</span>
<span class="p">}</span>
<span class="nx">exports</span><span class="p">.</span><span class="nx">ownRealKeys</span> <span class="o">=</span> <span class="nx">ownRealKeys</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>