cdocparser
Advanced tools
Comparing version 0.3.3 to 0.3.5
20
index.js
@@ -123,2 +123,3 @@ 'use strict'; | ||
/** | ||
@@ -204,7 +205,16 @@ * Capable of parsing comments and resolving @annotations | ||
// Fill in defaults | ||
Object.keys(annotations).forEach(function (key){ | ||
if ( key !== "_"){ | ||
var defaultFunc = annotations[key].default; | ||
if ( defaultFunc !== undefined && parsedComment[key] === undefined ) { | ||
parsedComment[key] = [defaultFunc()]; | ||
Object.keys(annotations).forEach(function (name){ | ||
if ( name !== '_' ){ | ||
var defaultFunc = annotations[name].default; | ||
if ( defaultFunc !== undefined && | ||
parsedComment[name] === undefined && | ||
isAnnotationAllowed(comment, annotations[name])) { | ||
var defaultValue = defaultFunc(parsedComment); | ||
if (defaultValue !== undefined) { | ||
if (Array.isArray(defaultValue)){ | ||
parsedComment[name] = defaultValue; | ||
} else { | ||
parsedComment[name] = [defaultValue]; | ||
} | ||
} | ||
} | ||
@@ -211,0 +221,0 @@ } |
{ | ||
"name": "cdocparser", | ||
"version": "0.3.3", | ||
"version": "0.3.5", | ||
"description": "Extract C style comments and extract context from source", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -120,2 +120,10 @@ CDocParser | ||
#### 0.3.5 | ||
* Use raw arrays returned from `default` as value. | ||
#### 0.3.4 | ||
* Pass in the parsed item to the `default` function | ||
#### 0.3.3 | ||
@@ -122,0 +130,0 @@ |
@@ -235,4 +235,6 @@ var fs = require('fs'); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20624
403
163