javascript - How to document deconstructed parameters with JsDoc -
how document function parameter gets deconstructed in function arguments?
/** * function deconstructs argument , stuff. * @param {} *** should here? *** */ function somefunction({ key1, key2, key3 }) { // function stuffs }
from @param wiki page:
if parameter destructured without explicit name, can give object appropriate 1 , document properties.
documenting destructuring parameter
/** * assign project employee. * @param {object} employee - employee responsible project. * @param {string} employee.name - name of employee. * @param {string} employee.department - employee's department. */ project.prototype.assign = function({ name, department }) { // ... };
Comments
Post a Comment