我正在尝试通过JSDoc3正确地注释它。
/**
* Module ...
*
* @module Cookie
* @returns {{create, get, remove}}
*/
const cookie = (function () {
/**
* Function to create cookie.
*
* @param {String} name - The cookie name.
* @param {String} value - The cookie value.
* @param {Boolean} elongate - The flag to extend cookie lifetime.
*/
const create = (name, value, elongate) => {
...
};
/**
* Function to get cookie.
*
* @param {String} key - The cookie identificatior to get.
* @returns {*}
*/
const get = (key) => {
...
};
/**
* Function to remove cookie.
*
* @param {String} key - The cookie identificator to remove.
*/
const remove = (key) => {
...
};
return {
create: create,
get: get,
remove: remove
}
})();
我这样做,但生成的文档看起来很糟糕。我不能将此部分代码重写为ES6标准。你能给些建议吗?