반응형
JSDoc을 사용하여 'const z = (y)' = > (a, b = 3) > []'를 문서화하는 방법
JSDoc에서 아래의 기능을 문서화할 방법을 찾아야 합니다.
/**
* Return the collection from cache based on the hash, page and pagination count
* @param state
* @returns {function({hash: *, page: *, pagination?: *}): ([]|*)}
*/
export const collection = (state) => ({ hash, page, pagination = 60 }) => {
if (!state.models[hash]) return []
// deep copy the object because of the collection property array
const model = JSON.parse(JSON.stringify(state.models[hash]))
const end = page * pagination
const start = end - pagination
return model.collection.splice(start, end)
}
편집
위의 코멘트를 로 변경하여 발생한 오류를 수정했습니다.
/**
* Return the collection from cache based on the hash, page and pagination count
* @type {object}
* @param state
* @returns {function({hash: *, page: *, pagination: *}): Array}
*/
다음의 에러가 표시됩니다.
ERROR: Unable to parse a tag's type expression for source file
/app/src/store/cache/getters.js in line 9 with tag title "returns"
and text "{function({hash: *, page: *, pagination?: *}): ([]|*)}":
Invalid type expression "function({hash: *, page: *, pagination?: *}):
([]|*)": Expected "#", "$", "(", ",", "-", ".", "/", "0", ":", "<",
"=", "@", "[]", "\\", "_", "}", "~", "", "", Unicode combining mark,
Unicode decimal number, Unicode letter number, Unicode lowercase letter,
Unicode modifier letter, Unicode other letter, Unicode punctuation
connector, Unicode titlecase letter, Unicode uppercase letter, or
[1-9] but "?" found.
패키지.json
"devDependencies": {
...
"jsdoc": "^3.6.5",
"jsdoc-vuejs": "^3.0.9",
"jsdoc-vuex-plugin": "^1.0.0",
...
},
https://github.com/Kocal/jsdoc-vuejs
https://github.com/martiensk/vuex-jsdoc
언급URL : https://stackoverflow.com/questions/70685018/how-to-use-jsdoc-to-document-const-z-y-a-b-3
반응형
'IT이야기' 카테고리의 다른 글
주석 @GetMapping과 @RequestMapping의 차이(메서드 = RequestMethod).취득) (0) | 2022.06.05 |
---|---|
편백으로 vuex 테스트 (0) | 2022.06.05 |
소품에 대해 단일 인용구를 사용하지 않는 방법 (0) | 2022.06.05 |
vue-class-component : TS2339(콜링 클래스 메서드) (0) | 2022.06.04 |
Vue 필터 및 "변환 핸들러 외부의 vuex 저장소 상태 변환 안 함" (0) | 2022.06.04 |