@es-joy/jsdoccomment
Advanced tools
Comparing version 0.30.0 to 0.31.0
# CHANGES for `@es-joy/jsdoccomment` | ||
## 0.31.0 | ||
- feat: support default values with `@template` per | ||
<https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#template> | ||
## 0.30.0 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "@es-joy/jsdoccomment", | ||
"version": "0.30.0", | ||
"version": "0.31.0", | ||
"author": "Brett Zamir <brettz9@yahoo.com>", | ||
@@ -5,0 +5,0 @@ "contributors": [], |
@@ -32,2 +32,3 @@ /* eslint-disable prefer-named-capture-group -- Temporary */ | ||
const optionalBrackets = /^\[(?<name>[^=]*)=[^\]]*\]/u; | ||
const preserveTypeTokenizer = typeTokenizer('preserve'); | ||
@@ -63,3 +64,3 @@ const preserveDescriptionTokenizer = descriptionTokenizer('preserve'); | ||
const name = pos === -1 ? remainder : remainder.slice(0, pos); | ||
let name = pos === -1 ? remainder : remainder.slice(0, pos); | ||
const extra = remainder.slice(pos); | ||
@@ -71,4 +72,10 @@ let postName = '', description = '', lineEnd = ''; | ||
if (optionalBrackets.test(name)) { | ||
name = name.match(optionalBrackets)?.groups?.name; | ||
spec.optional = true; | ||
} else { | ||
spec.optional = false; | ||
} | ||
spec.name = name; | ||
spec.optional = false; | ||
const {tokens} = spec.source[0]; | ||
@@ -75,0 +82,0 @@ tokens.name = name; |
Sorry, the diff of this file is not supported yet
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
75657
1507