Skip to content

Commit 4ddba31

Browse files
Merge branch 'master' into predict-ts-functions-types
2 parents 91ea5d8 + 9ecab03 commit 4ddba31

File tree

3 files changed

+40
-16
lines changed

3 files changed

+40
-16
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
notify:
5454
name: Notify
5555
runs-on: ubuntu-latest
56-
if: always()
56+
if: failure()
5757
needs:
5858
- test
5959
- setup

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313
},
1414
"author": "Wojciech Krysiak",
1515
"license": "MIT",
16+
"dependencies": {
17+
"brace": "^0.11.1",
18+
"react-ace": "^9.5.0",
19+
"react-docgen": "^5.4.0",
20+
"react-frame-component": "^5.2.1",
21+
"typescript": "^4.5.4",
22+
"underscore": "^1.13.2",
23+
"vue-docgen-api": "^3.26.0",
24+
"vue2-ace-editor": "^0.0.15"
25+
},
26+
"peerDependencies": {
27+
"react": "^17.0.2",
28+
"react-dom": "^17.0.2"
29+
},
1630
"devDependencies": {
1731
"@babel/cli": "^7.16.8",
1832
"@babel/core": "^7.16.7",
@@ -45,21 +59,6 @@
4559
"sass": "^1.48.0",
4660
"semantic-release": "^18.0.1"
4761
},
48-
"peerDependencies": {
49-
"react": "^17.0.2",
50-
"react-dom": "^17.0.2",
51-
"typescript": "^4.5.4"
52-
},
53-
"dependencies": {
54-
"brace": "^0.11.1",
55-
"react-ace": "^9.5.0",
56-
"react-docgen": "^5.4.0",
57-
"react-frame-component": "^5.2.1",
58-
"typescript": "^4.5.4",
59-
"underscore": "^1.13.2",
60-
"vue-docgen-api": "^3.26.0",
61-
"vue2-ace-editor": "^0.0.15"
62-
},
6362
"husky": {
6463
"hooks": {
6564
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"

typescript/type-converter.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,31 @@ const fillMethodComment = (comment, member, src) => {
100100
return comment
101101
}
102102

103+
/**
104+
* Fill missing method declaration
105+
*
106+
* @param {string} comment
107+
* @param member
108+
* @param {string} src
109+
* @return {string}
110+
*/
111+
const fillMethodComment = (comment, member, src) => {
112+
if (!comment.includes('@method')) {
113+
comment = appendComment(comment, '@method')
114+
}
115+
if (!comment.includes('@param')) {
116+
comment = convertParams(comment, member, src)
117+
}
118+
if (ts.isArrayTypeNode(member.type)) {
119+
comment = convertMembers(comment, member.type, src)
120+
}
121+
if (!comment.includes('@return')) {
122+
const returnType = getTypeName(member.type, src)
123+
comment = appendComment(comment, `@return {${returnType}}`)
124+
}
125+
return comment
126+
}
127+
103128
/**
104129
* converts function parameters to @params
105130
*

0 commit comments

Comments
 (0)