Navigation Menu

Skip to content

Commit

Permalink
Added: JSON Array support.
Browse files Browse the repository at this point in the history
  • Loading branch information
fkei committed Mar 2, 2016
1 parent 35d0e86 commit 758f343
Show file tree
Hide file tree
Showing 51 changed files with 11,911 additions and 394 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
.DS_Store
node_modules
npm-debug.log
.idea
*.iml
2 changes: 1 addition & 1 deletion Makefile
@@ -1,4 +1,4 @@
__jsdoc=node_modules/jsdoc/jsdoc
__jsdoc=node_modules/.bin/jsdoc
__plato=node_modules/plato/bin/plato
__mocha=node_modules/.bin/mocha
__jshint=node_modules/jshint/bin/jshint
Expand Down
30 changes: 30 additions & 0 deletions TestDoc.html
Expand Up @@ -15,5 +15,35 @@ <h1>JSON.minify</h1>
<dd><pre><code>var json = fs.readFileSync(__dirname + '/plain.json', 'utf8');
var res = JSON.parse(JSON.minify(json));
res.foo.should.equal('bar');</code></pre></dd>
<dt>in-memory string json.array plain</dt>
<dd><pre><code>var json = '[1,2,3]';
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>
<dd><pre><code>var json = '//[1,2,3]\n[4,5,6,7]';
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>
<dd><pre><code>var json = '/**[1,2,3]*/[8,9,10,11]';
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>
<dd><pre><code>var json = '[4,5,6,7]//[1,2,3]';
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>
<dd><pre><code>var json = '[8,9,10,11]/**[1,2,3]*/';
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>
<dd><pre><code>var json = fs.readFileSync(__dirname + '/array_comment.json', 'utf8');
var res = JSON.parse(JSON.minify(json));
should(res.length).be.exactly(3).and.be.a.Number();
should(res[0]['somethi&quot;&quot;ng'].length).be.exactly(4).and.be.a.Number();
should(res[0]['somethi&quot;&quot;ng'][3]).be.exactly(23).and.be.a.Number();</code></pre></dd>
</dl>
</section>

0 comments on commit 758f343

Please sign in to comment.