hegemonic / jsdoc-baseline

An experimental, extensible template for JSDoc.
Other
61 stars 32 forks source link

Optional object properties are missing from docs #161

Closed SunboX closed 9 years ago

SunboX commented 9 years ago

The option options.knowsAboutUsFrom in this sample is missing from the docs:

/**
 *
 * ```js
 * var user = new User({
 *     email: 'john.doe@domain.tld'
 * });
 * ```
 *
 * @class User
 * @classdesc User object.
 */
var User = (function() {
    /**
     *
     * @param {object} options                        - Options to initialize the user with
     *
     * @param {string} options.email                  - The user's email address, sets {@link User#email}
     * @param {string=} options.knowsAboutUsFrom      - Where does the user know about us from, sets {@link User#knowsAboutUsFrom}
     * @param {@link LoyaltyCardFeature=} options.loyaltyCardFeature - The user's loyalty card information, sets {@link User#loyaltyCardFeature}
     */
    var User = function(options) {

        /**
         * The user's email address.
         *
         * @name User#email
         * @type string
         */
        this.email = options.email;
        this.userName = options.email;
    };

    return User;

})();
SunboX commented 9 years ago

To get the example working I had to add a @constructs User tag to the inner declaration of User. :blush: