-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cosmetic changes to all files to match new styles
Implemented eslint and mostly airbnb's style guide.
- Loading branch information
Showing
15 changed files
with
276 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/** | ||
* @module Passage | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var Route = require('./lib/route'); | ||
|
||
|
||
module.exports = Route; | ||
module.exports = Route; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
'use strict'; | ||
|
||
var createVisitor = require('./create_visitor'); | ||
var createVisitor = require('./create_visitor'); | ||
|
||
/** | ||
* Visitor for the AST to reconstruct the normalized input | ||
* @class ReconstructVisitor | ||
* @borrows Visitor-visit | ||
*/ | ||
var ReconstructVisitor = createVisitor({ | ||
'Concat': function(node) { | ||
Concat: function (node) { | ||
return node.children | ||
.map( function(child) { | ||
.map(function (child) { | ||
return this.visit(child); | ||
}.bind(this)) | ||
.join(''); | ||
}, | ||
|
||
'Literal': function(node) { | ||
Literal: function (node) { | ||
return node.props.value; | ||
}, | ||
|
||
'Splat': function(node) { | ||
Splat: function (node) { | ||
return '*' + node.props.name; | ||
}, | ||
|
||
'Param': function(node) { | ||
Param: function (node) { | ||
return ':' + node.props.name; | ||
}, | ||
|
||
'Optional': function(node) { | ||
Optional: function (node) { | ||
return '(' + this.visit(node.children[0]) + ')'; | ||
}, | ||
|
||
'Root': function(node) { | ||
Root: function (node) { | ||
return this.visit(node.children[0]); | ||
} | ||
}); | ||
|
||
module.exports = ReconstructVisitor; | ||
module.exports = ReconstructVisitor; |
Oops, something went wrong.