blob: 1e95afd158a8b0459f697c421ea0ff005ca1a101 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
<!DOCTYPE html> <html> <head> <title>psdassert.coffee</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="blackwhite.html"> blackwhite.coffee </a> <a class="source" href="brightnesscontrast.html"> brightnesscontrast.coffee </a> <a class="source" href="colorbalance.html"> colorbalance.coffee </a> <a class="source" href="curves.html"> curves.coffee </a> <a class="source" href="exposure.html"> exposure.coffee </a> <a class="source" href="gradient.html"> gradient.coffee </a> <a class="source" href="huesaturation.html"> huesaturation.coffee </a> <a class="source" href="invert.html"> invert.coffee </a> <a class="source" href="layereffect.html"> layereffect.coffee </a> <a class="source" href="levels.html"> levels.coffee </a> <a class="source" href="pattern.html"> pattern.coffee </a> <a class="source" href="photofilter.html"> photofilter.coffee </a> <a class="source" href="posterize.html"> posterize.coffee </a> <a class="source" href="selectivecolor.html"> selectivecolor.coffee </a> <a class="source" href="solidcolor.html"> solidcolor.coffee </a> <a class="source" href="threshold.html"> threshold.coffee </a> <a class="source" href="typetool.html"> typetool.coffee </a> <a class="source" href="vibrance.html"> vibrance.coffee </a> <a class="source" href="log.html"> log.coffee </a> <a class="source" href="psd.html"> psd.coffee </a> <a class="source" href="psdassert.html"> psdassert.coffee </a> <a class="source" href="psdchannelimage.html"> psdchannelimage.coffee </a> <a class="source" href="psdcolor.html"> psdcolor.coffee </a> <a class="source" href="psddescriptor.html"> psddescriptor.coffee </a> <a class="source" href="psdfile.html"> psdfile.coffee </a> <a class="source" href="psdheader.html"> psdheader.coffee </a> <a class="source" href="psdimage.html"> psdimage.coffee </a> <a class="source" href="psdlayer.html"> psdlayer.coffee </a> <a class="source" href="psdlayermask.html"> psdlayermask.coffee </a> <a class="source" href="psdresource.html"> psdresource.coffee </a> <a class="source" href="util.html"> util.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> psdassert.coffee </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>Quick and dirty assertion polyfill for browsers</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">assert = </span><span class="nx">do</span> <span class="nf">(assert) -></span>
<span class="k">return</span> <span class="nx">require</span> <span class="s1">'assert'</span> <span class="k">if</span> <span class="nx">exports</span><span class="o">?</span>
<span class="nv">assert = </span><span class="nf">(test) -></span>
<span class="k">throw</span> <span class="s2">"Assertion error"</span> <span class="nx">unless</span> <span class="nx">test</span> <span class="o">==</span> <span class="kc">true</span>
<span class="nv">assert.equal = </span><span class="nf">(actual, expected) -></span>
<span class="k">throw</span> <span class="s2">"Assertion error"</span> <span class="nx">unless</span> <span class="nx">actual</span> <span class="o">is</span> <span class="nx">expected</span>
<span class="k">return</span> <span class="nx">assert</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|