Skip to content

Commit

Permalink
Fix qunit and eslint issues
Browse files Browse the repository at this point in the history
PR-URL: #2
  • Loading branch information
tshemsedinov committed Dec 20, 2017
1 parent c8c5de3 commit e8a91ea
Show file tree
Hide file tree
Showing 5 changed files with 690 additions and 116 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
node_js:
- "6"
- "7"
- "8"
- "9"
script:
- npm test
20 changes: 12 additions & 8 deletions bin/mkdoc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
var dox = require('dox'),
fs = require('fs'),
code = fs.readFileSync(__dirname + '/../index.js').toString('utf8'),
ast = dox.parseComments(code, {raw: true}),
apiDoc = dox.api(ast),
tpl, readme;
'use strict';

const dox = require('dox');
const fs = require('fs');

const code = fs.readFileSync(__dirname + '/../index.js').toString('utf8');
const ast = dox.parseComments(code, { raw: true });

let apiDoc = dox.api(ast);

// Don't like the new format Do.method
apiDoc = apiDoc
.replace(/Do\./g, 'Do#')
.replace('##', '###')
.trim();
tpl = fs.readFileSync(__dirname + '/readme.tpl', 'utf8');
readme = tpl.replace('{api}', apiDoc);

const tpl = fs.readFileSync(__dirname + '/readme.tpl', 'utf8');
const readme = tpl.replace('{api}', apiDoc);
fs.writeFileSync(__dirname + '/../readme.md', readme);

console.log('Written readme.md');
2 changes: 1 addition & 1 deletion do.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Do.prototype.errors;
* @api public
*/
Do.prototype.amount = function(value) {
if (value !== null) {
if (typeof(value) === 'number') {
this._amount = value;
return this;
}
Expand Down
Loading

0 comments on commit e8a91ea

Please sign in to comment.