Skip to content

Instantly share code, notes, and snippets.

@scottnath
Created May 27, 2015 16:19
Show Gist options
  • Save scottnath/bcf5f1ec55fcc8e1017f to your computer and use it in GitHub Desktop.
Save scottnath/bcf5f1ec55fcc8e1017f to your computer and use it in GitHub Desktop.
dox parsing bug example
file: https://github.com/pattern-library/pattern-library-utilities/blob/master/lib/get-options.js
$ dox < lib/get-options.js
[
{
"tags": [
{
"type": "fileoverview",
"string": "Takes two options objects and merges them \n @author Scott Nath\n\n @requires NPM:lodash.merge",
"html": "<p>Takes two options objects and merges them<br /> @author Scott Nath</p><p> @requires NPM:lodash.merge</p>"
}
],
"description": {
"full": "",
"summary": "",
"body": ""
},
"isPrivate": false,
"isConstructor": false,
"isClass": false,
"isEvent": false,
"ignore": false,
"line": 1,
"codeStart": 8,
"code": "'use strict';\n\nvar merge = require('lodash.merge');",
"ctx": false
},
{
"tags": [
{
"type": "param",
"string": "{object} appDefaultOptions the app's default options",
"name": "appDefaultOptions",
"description": "<p>the app&#39;s default options</p>",
"types": [
"object"
],
"typesDescription": "<code>object</code>",
"optional": false,
"nullable": false,
"nonNullable": false,
"variable": false
},
{
"type": "param",
"string": "{object} projectOptions the project's options",
"name": "projectOptions",
"description": "<p>the project&#39;s options</p>",
"types": [
"object"
],
"typesDescription": "<code>object</code>",
"optional": false,
"nullable": false,
"nonNullable": false,
"variable": false
}
],
"description": {
"full": "<p>Returns an merged object of two options objects</p>",
"summary": "<p>Returns an merged object of two options objects</p>",
"body": ""
},
"isPrivate": false,
"isConstructor": false,
"isClass": false,
"isEvent": false,
"ignore": false,
"line": 12,
"codeStart": 18,
"code": "exports.getOptions = function (options, projectOptions) {",
"ctx": {
"type": "method",
"receiver": "exports",
"name": "getOptions",
"string": "exports.getOptions()"
}
},
{
"tags": [],
"description": {
"full": "<p>merge project and default options</p>",
"summary": "<p>merge project and default options</p>",
"body": ""
},
"isPrivate": false,
"isConstructor": false,
"isClass": false,
"isEvent": false,
"ignore": false,
"line": 20,
"codeStart": 21,
"code": "merge(options, projectOptions, function (a, b) {\n return Array.isArray(a) ? b : undefined;\n});\n\nif(!Array.isArray(options.dependencies)){\n options.dependencies = [String(options.dependencies)];\n}\n\nreturn options;\n}",
"ctx": {
"type": "method",
"name": "merge",
"string": "merge()"
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment