File: TestDoc.html

package info (click to toggle)
node-jsonminify 0.4.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 132 kB
  • sloc: javascript: 120; makefile: 23
file content (59 lines) | stat: -rw-r--r-- 3,452 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    <section class="suite">
      <h1>JSON.minify</h1>
      <dl>
        <dt>define</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>JSON.minify.should.be.ok;</code></pre></dd>
        <dt>in-memory string</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = &#x27;{&#x22;key&#x22;:&#x22;value&#x22;}&#x27;;
var res = JSON.minify(json);
JSON.parse(res).key.should.equal(&#x27;value&#x27;);</code></pre></dd>
        <dt>comment.json</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = fs.readFileSync(__dirname + &#x27;/comment.json&#x27;, &#x27;utf8&#x27;);
var res = JSON.parse(JSON.minify(json));
res.foo.should.equal(&#x27;bar&#x27;);</code></pre></dd>
        <dt>comment.json</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = fs.readFileSync(__dirname + &#x27;/plain.json&#x27;, &#x27;utf8&#x27;);
var res = JSON.parse(JSON.minify(json));
res.foo.should.equal(&#x27;bar&#x27;);</code></pre></dd>
        <dt>in-memory string json.array plain</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = &#x27;[1,2,3]&#x27;;
var res = JSON.parse(JSON.minify(json));
res.length.should.equal(3);</code></pre></dd>
        <dt>in-memory string json.array start line comment</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = &#x27;//[1,2,3]\n[4,5,6,7]&#x27;;
var res = JSON.parse(JSON.minify(json));
res.length.should.equal(4);
should(res[0]).be.exactly(4).and.be.a.Number();</code></pre></dd>
        <dt>in-memory string json.array start multi comment</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = &#x27;/**[1,2,3]*/[8,9,10,11]&#x27;;
var res = JSON.parse(JSON.minify(json));
res.length.should.equal(4);
should(res[0]).be.exactly(8).and.be.a.Number();</code></pre></dd>
        <dt>in-memory string json.array end line comment</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = &#x27;[4,5,6,7]//[1,2,3]&#x27;;
var res = JSON.parse(JSON.minify(json));
res.length.should.equal(4);
should(res[0]).be.exactly(4).and.be.a.Number();</code></pre></dd>
        <dt>in-memory string json.array end multi comment</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = &#x27;[8,9,10,11]/**[1,2,3]*/&#x27;;
var res = JSON.parse(JSON.minify(json));
res.length.should.equal(4);
should(res[0]).be.exactly(8).and.be.a.Number();</code></pre></dd>
        <dt>array_comment.json</dt>
        <dt>/Users/a12057/scm/github.com/fkei/JSON.minify/test/test-minify.json.js</dt>
        <dd><pre><code>var json = fs.readFileSync(__dirname + &#x27;/array_comment.json&#x27;, &#x27;utf8&#x27;);
var res = JSON.parse(JSON.minify(json));
should(res.length).be.exactly(3).and.be.a.Number();
should(res[0][&#x27;somethi&#x22;&#x22;ng&#x27;].length).be.exactly(4).and.be.a.Number();
should(res[0][&#x27;somethi&#x22;&#x22;ng&#x27;][3]).be.exactly(23).and.be.a.Number();</code></pre></dd>
      </dl>
    </section>