jsdoc/test/fixtures/defaultparams.js
Jeff Williams 878115e1c1 autodetect string, boolean, and numeric default values of parameters (#555)
We ignore other types based on these assumptions:

1) It doesn't make sense to show variable identifiers, which may refer to (for example) module-private values that should not be documented.
2) If we tried to capture objects and arrays, we would have to iterate over them to see if they contain any variable identifiers, which would be a pain (and potentially confusing: "Why do some objects appear in the docs but not others?")
3) Most developers will not define complex default values in a function definition.
4) In many cases, object and array default values will be `{}` and `[]`, respectively, and usually those don't merit documentation.
2015-03-03 17:22:30 -08:00

65 lines
1.5 KiB
JavaScript

'use strict';
const PIZZA_TOPPING_DEFAULTS = {
SARDINES: true,
MUSTARD: true,
PIQUANT_CHILI_SPRINKLES: true
};
/**
* Set the user's first name.
*
* @param {string} firstName - The user's first name.
*/
function setFirstName(firstName = 'Buster') {}
/**
* Set the user's last name.
*
* @param {string} [lastName=Braun] - The user's last name.
*/
function setLastName(lastName = 'Brown') {}
/**
* Set the user's first, middle, and last names.
*
* @param {string} firstName - The user's first name.
* @param {string} middleName - The user's middle name.
* @param {string} lastName - The user's last name.
*/
function setName(firstName, middleName = 'Bluster', lastName = 'Brown') {}
/**
* Set the user's manager.
*
* @param {Manager} manager - The manager.
*/
function setManager(manager = {}) {}
/**
* Set whether the user is currently active.
*
* @param {boolean} isActive - Set to `true` if active; otherwise, `false`.
*/
function setActive(isActive = true) {}
/**
* Set the year in which the employee was born.
* @param {number} year - The four-digit birth year.
*/
function setBirthYear(year = 3000) {}
/**
* Set the name of the user's dog. At this time, only one dog is supported.
*
* @param {string} dogName - The name of the user's dog.
*/
function setDogName(dogName = '') {}
/**
* Set the user's favorite pizza toppings.
*
* @param {PizzaToppings} toppings - The user's favorite toppings.
*/
function setPizzaToppings(toppings = PIZZA_TOPPING_DEFAULTS) {}