Open stowball opened 8 years ago
In ES6, you can specify default parameters for functions as described here: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/default_parameters
Sublime and DocBlockr support them well. For example:
/** * [description] * @param {Number} maxPosts [description] * @param {String} filter [description] * @return {[type]} [description] */ export default function (maxPosts = 2, filter = '') { } /** * [description] * @param {Number} options.maxPosts [description] * @param {String} options.filter [description] * @return {[type]} [description] */ export default function ({maxPosts = 2, filter = ''}) { } /** * [description] * @param {Number} options.maxPosts [description] * @param {String} options.filter [description] * @return {[type]} [description] */ export default function ({maxPosts = 2, filter = ''} = {}) { }
whereas, FuncDocr for the same will produce:
/** * [[Description]] * @param {[[Type]]} maxPosts = 2 [[Description]] * @param {[[Type]]} filter = '' [[Description]] */ export default function (maxPosts = 2, filter = '') { } export default function ({maxPosts = 2, filter = ''}) { } export default function ({maxPosts = 2, filter = ''} = {}) { }
Default parameters can also be arrays, functions and more, but I haven't had a need for anything else yet so can't tell you how they're documented.
Okay, never ever used it :D I'll have a look! Thanks for the issue ;)
In ES6, you can specify default parameters for functions as described here: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/default_parameters
Sublime and DocBlockr support them well. For example:
whereas, FuncDocr for the same will produce:
Default parameters can also be arrays, functions and more, but I haven't had a need for anything else yet so can't tell you how they're documented.