Repository: eslint/doctrine (js)

Issue:
Support case insensitive tags
**What version are you using?**
master

**What JSDoc comment were you trying to parse?**
/** @Const {String} constname */

**What Doctrine options were you using (sloppy, unwrap, etc.)?**
{ unwrap: true }

**What happened? Include output if possible.**
Tag gets parsed as 
```
{ description: '{String} constname', title: 'Const' }
```

**What did you expect to happen?**
Tag gets parsed as 
```
{
  description: null,
  name: 'constname',
  title: 'Const',
  type: { name: 'String', type: 'NameExpression' }
}
```

See eslint related issues: https://github.com/eslint/eslint/issues/6121 https://github.com/eslint/eslint/issues/6145


Pull request description:
Fix: Support case insensitive tags (fixes #163)

Patch:
diff --git a/lib/doctrine.js b/lib/doctrine.js
index f0080b1..23d6e39 100644
--- a/lib/doctrine.js
+++ b/lib/doctrine.js
@@ -404,7 +404,7 @@
 
         function TagParser(options, title) {
             this._options = options;
-            this._title = title;
+            this._title = title.toLowerCase();
             this._tag = {
                 title: title,
                 description: null


Test patch:
diff --git a/test/parse.js b/test/parse.js
index a50114a..047cc8b 100644
--- a/test/parse.js
+++ b/test/parse.js
@@ -78,6 +78,18 @@ describe('parse', function () {
         });
     });
 
+    it('Const with type and name', function () {
+        var res = doctrine.parse('/** @Const {String} constname */', { unwrap: true });
+        res.tags.should.have.length(1);
+        res.tags[0].should.have.property('title', 'Const');
+        res.tags[0].should.have.property('name', 'constname');
+        res.tags[0].should.have.property('type');
+        res.tags[0].type.should.eql({
+            type: 'NameExpression',
+            name: 'String'
+        });
+    });
+
     it('constant with type and name', function () {
         var res = doctrine.parse('/** @constant {String} constname */', { unwrap: true });
         res.tags.should.have.length(1);