Skip to content

Commit

Permalink
Fix tag name of 'export default' pattern from 'exports' to 'export de…
Browse files Browse the repository at this point in the history
…fault'.
  • Loading branch information
Joouis committed Nov 24, 2017
1 parent f2f014b commit 594bcc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## v0.2.0 (2017.11.23)

- New toolbox section is provided with four shortcut buttons.
- Fix [#11](https://github.com/alibaba/structure-view/issues/11). Support export class/function expression.
- Fix tag name of 'export default' pattern from 'exports' to 'export default'.
- Change trigger event for folding tree view to double click by default (See [#13](https://github.com/alibaba/structure-view/issues/13)), and make this behavior configurable.

### v0.1.8 (2017.11.20)
Expand Down
6 changes: 4 additions & 2 deletions lib/tag-generators/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ export default {
* Pattern: export default expression;
*/
else if ('ExportDefaultDeclaration' === type) {
// TODO: name should be more specific!
name = 'export';
name = 'export default';
id = `${line}-${name}`;
type = 'class';

let dec = i.declaration;

// Ignore 'export default XXX;', XXX should have been parsed before
if ('ObjectExpression' === dec.type &&
dec.properties.length > 0)
{
Expand Down Expand Up @@ -129,6 +130,7 @@ export default {
*/
else if ('ExportNamedDeclaration' === type) {
let dec = i.declaration;

name = dec.id.name;
id = `${line}-${name}`;
type = 'class';
Expand Down

0 comments on commit 594bcc4

Please sign in to comment.