Skip to content

Commit cfbd6f4

Browse files
committed
Removed object destructuring to support older versions of Node.js
Changed packageFile to package.
1 parent 98c8e9f commit cfbd6f4

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = grunt => {
1414
'title': 'Sample Title',
1515
'description': 'Lorem ipsum dolor sit amet, consectetur adipisicing elit',
1616
'layout': 'test/fixtures/template.hbs',
17-
'packageFile': 'test/fixtures/package.json'
17+
'package': 'test/fixtures/package.json'
1818
}
1919
}
2020
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = function (grunt) {
5050
'title': 'Sample Title',
5151
'description': 'Lorem ipsum dolor sit amet, consectetur adipisicing elit',
5252
'layout': 'docs/template.hbs',
53-
'packageFile': 'package.json'
53+
'package': 'package.json'
5454
}
5555
}
5656
}

tasks/doxdox.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@ module.exports = grunt => {
77

88
const done = this.async();
99

10-
const {inputs, output} = this.data;
10+
const inputs = this.data.inputs;
11+
const output = this.data.output;
1112

12-
const {description, ignore, layout, packageFile, parser, title} = this.data.config || {};
13+
const config = this.data.config || {};
1314

14-
const pkg = grunt.file.readJSON(utils.findPackageFileInPath(packageFile || 'package.json'));
15+
const pkg = grunt.file.readJSON(utils.findPackageFileInPath(config.package || 'package.json'));
1516

1617
doxdox.parseInputs(inputs, {
17-
'description': description || pkg.description || '',
18-
'ignore': (ignore || '').split(/\s*,\s*/),
19-
'layout': (layout || 'markdown').toLowerCase(),
20-
'parser': (parser || 'dox').toLowerCase(),
18+
'description': config.description || pkg.description || '',
19+
'ignore': (config.ignore || '').split(/\s*,\s*/),
20+
'layout': (config.layout || 'markdown').toLowerCase(),
21+
'parser': (config.parser || 'dox').toLowerCase(),
2122
pkg,
22-
'title': title || pkg.name || 'Untitled Project'
23+
'title': config.title || pkg.name || 'Untitled Project'
2324
}).then(content => {
2425

2526
grunt.file.write(output, content, {'encoding': 'utf8'});

0 commit comments

Comments
 (0)