diff options
| -rw-r--r-- | docs/collect.js | 6 | ||||
| -rw-r--r-- | docs/spec/collectSpec.js | 20 | ||||
| -rw-r--r-- | src/formatters.js | 8 | ||||
| -rw-r--r-- | src/services.js | 2 |
4 files changed, 13 insertions, 23 deletions
diff --git a/docs/collect.js b/docs/collect.js index 5a5e3ee9..2cb85fe2 100644 --- a/docs/collect.js +++ b/docs/collect.js @@ -208,12 +208,12 @@ function propertyTag(doc, name, value) { } function returnsTag(doc, name, value) { - var match = value.match(/^({(\S+)}\s*)?(.*)?/); + var match = value.match(/^{(\S+)}\s+(.*)?/); if (match) { var tag = { - type: match[2], - description: match[3] || false + type: match[1], + description: match[2] || false }; } else { throw "[" + doc.raw.file + ":" + doc.raw.line + diff --git a/docs/spec/collectSpec.js b/docs/spec/collectSpec.js index 4d398be3..7777e8f4 100644 --- a/docs/spec/collectSpec.js +++ b/docs/spec/collectSpec.js @@ -161,24 +161,14 @@ describe('collect', function(){ }); describe('@returns', function() { - it('should parse @returns', function() { - expect(function() {TAG.returns(doc, 'returns', '');}) - .not.toThrow(); - }); - - it('should parse @returns with type', function() { - TAG.returns(doc, 'returns', '{string}'); - expect(doc.returns.type).toEqual('string'); - }); - - it('should parse @returns with description', function() { - TAG.returns(doc, 'returns', 'descrip tion'); - expect(doc.returns.description).toEqual('descrip tion'); + it('should not parse @returns without type', function() { + expect(function() {TAG.returns(doc, 'returns', 'lala');}) + .toThrow(); }); it('should parse @returns with type and description', function() { - TAG.returns(doc, 'returns', '{string} description'); - expect(doc.returns).toEqual({type: 'string', description: 'description'}); + TAG.returns(doc, 'returns', '{string} descrip tion'); + expect(doc.returns).toEqual({type: 'string', description: 'descrip tion'}); }); }); diff --git a/src/formatters.js b/src/formatters.js index 38175d7d..85be7019 100644 --- a/src/formatters.js +++ b/src/formatters.js @@ -38,7 +38,7 @@ angularFormatter.json = formatter(toJson, fromJson); * @description * Use boolean formatter if you wish to store the data as boolean. * - * @returns Convert to `true` unless user enters (blank), `f`, `false`, `0`, `no`, `[]`. + * @returns {boolean} Converts to `true` unless user enters (blank), `f`, `false`, `0`, `no`, `[]`. * * @example * Enter truthy text: @@ -62,7 +62,7 @@ angularFormatter['boolean'] = formatter(toString, toBoolean); * @description * Use number formatter if you wish to convert the user entered string to a number. * - * @returns parse string to number. + * @returns {number} Number from the parsed string. * * @example * Enter valid number: @@ -89,9 +89,9 @@ angularFormatter.number = formatter(toString, function(obj){ * @name angular.formatter.list * * @description - * Use number formatter if you wish to convert the user entered string to a number. + * Use list formatter if you wish to convert the user entered string to an array. * - * @returns parse string to number. + * @returns {Array} Array parsed from the entered string. * * @example * Enter a list of items: diff --git a/src/services.js b/src/services.js index 5dfc64f7..f0a15c1b 100644 --- a/src/services.js +++ b/src/services.js @@ -994,7 +994,7 @@ angularServiceInject('$cookieStore', function($store) { * Returns the value of given cookie key * * @param {string} key - * @returns Cookie value + * @returns {Object} Deserialized cookie value */ get: function(/**string*/key) { return fromJson($store[key]); |
