You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionparseName(tagInfo){// like '[foo]' or '[ foo ]' or '[foo=bar]' or '[ foo=bar ]' or '[ foo = bar ]'// or 'foo=bar' or 'foo = bar'if(/^(\[)?\s*(.+?)\s*(\])?$/.test(tagInfo.name)){^^^^^^^^^^^^^^^^^^^^^^^^^tagInfo.name=RegExp.$2;// were the "optional" brackets present?if(RegExp.$1&&RegExp.$3){tagInfo.optional=true;}// like 'foo=bar' or 'foo = bar'if(/^(.+?)\s*=\s*(.+)$/.test(tagInfo.name)){tagInfo.name=RegExp.$1;tagInfo.defaultvalue=jsdoc.util.cast.cast(RegExp.$2);}}returntagInfo;}
Current behavior
My comment is @property {Array<String>} [name=[" 1 "]] description, and it seems to typecast the string.
Why is there no conversion to object format. Please see jsdoc/util/cast.js
Output behavior
The default value is [" 1 ".
Your environment
Software
Version
JSDoc
4.0.2
Node.js
14.21.2
npm
6.14.17
The text was updated successfully, but these errors were encountered:
QianSeNianHua
changed the title
JSDoc does not parse the default value of the property tag
JSDoc does not correctly parse the default value of the property tag
Sep 8, 2023
JSDoc code
jsdoc/tag/type.js
jsdoc/util/cast.js
Current behavior
My comment is
@property {Array<String>} [name=[" 1 "]] description
, and it seems to typecast the string.Why is there no conversion to object format. Please see
jsdoc/util/cast.js
Output behavior
The default value is
[" 1 "
.Your environment
The text was updated successfully, but these errors were encountered: