Skip to content

Commit 6477b05

Browse files
committed
Fixed processing grammar rules even for empty name
1 parent 47850f7 commit 6477b05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ module.exports = function(version) {
237237
},
238238
grammarize: function(language, name, grammar) {
239239
if (!language) throw new Error('No language code provided');
240-
// Process way/rotary name with applying grammar rules if any
241-
if (name && grammar && grammars && grammars[language] && grammars[language][version]) {
240+
// Process way/rotary/any name with applying grammar rules if any
241+
if (grammar && grammars && grammars[language] && grammars[language][version]) {
242242
var rules = grammars[language][version][grammar];
243243
if (rules) {
244244
// Pass original name to rules' regular expressions enclosed with spaces for simplier parsing

0 commit comments

Comments
 (0)