Skip to content

Commit f7d46ad

Browse files
authored
Merge pull request #29 from andnp/LatestTS
Latest ts
2 parents 27b5969 + feef962 commit f7d46ad

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"ts-jest": "^23.0.0",
4343
"ts-node": "^7.0.0",
4444
"tslint": "^5.9.1",
45-
"typescript": "~2.8.1"
45+
"typescript": "^3.2.4"
4646
},
4747
"commitlint": {
4848
"extends": [

scripts/generateDocumentation.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,20 @@ const buildTypeInfoFromNode = (fileName: string, checker: tsc.TypeChecker, node:
6161
.map(tag => tag.text)
6262
.filter(text => !!text)[0];
6363

64+
const cleanedExample = example && example
65+
.split('\n')
66+
.map(line =>
67+
line.trimLeft().startsWith('*')
68+
? line.trimLeft().substr(1).trimLeft()
69+
: line
70+
)
71+
.join('\n');
72+
6473
const typeInfo: TypeInfo = {
74+
example: cleanedExample,
6575
typeName,
6676
parameterDocs,
6777
returnDocs: returnDocs[0],
68-
example,
6978
description,
7079
fileName,
7180
};
@@ -229,5 +238,5 @@ console.log(markdown);
229238

230239
/** True if this is visible outside this file, false otherwise */
231240
function isNodeExported(node: tsc.Node): boolean {
232-
return (tsc.getCombinedModifierFlags(node) & tsc.ModifierFlags.Export) !== 0 || (!!node.parent && node.parent.kind === tsc.SyntaxKind.SourceFile); // tslint:disable-line no-bitwise
241+
return (tsc.getCombinedModifierFlags(node as tsc.Declaration) & tsc.ModifierFlags.Export) !== 0 || (!!node.parent && node.parent.kind === tsc.SyntaxKind.SourceFile); // tslint:disable-line no-bitwise
233242
}

0 commit comments

Comments
 (0)