【发布时间】:2017-12-14 11:19:36
【问题描述】:
我正在尝试弄清楚如何使用 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 标准。可以请教吗?
【问题讨论】:
-
也很想知道,好像de IIFE里面的一切都被忽略了
标签: javascript documentation jsdoc