@travetto/transformer 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/state.ts +10 -0
- package/src/util/doc.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/transformer",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Functionality for AST transformations, with transformer registration, and general utils",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"directory": "module/transformer"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@travetto/manifest": "^6.0.
|
|
27
|
+
"@travetto/manifest": "^6.0.1",
|
|
28
28
|
"tslib": "^2.8.1",
|
|
29
|
-
"typescript": "^5.
|
|
29
|
+
"typescript": "^5.9.3"
|
|
30
30
|
},
|
|
31
31
|
"travetto": {
|
|
32
32
|
"displayName": "Transformation",
|
package/src/state.ts
CHANGED
|
@@ -129,6 +129,16 @@ export class TransformerState implements State {
|
|
|
129
129
|
return DocUtil.readDocTag(this.#resolver.getType(node), name);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Read all JSDoc tags as a list, with split support
|
|
134
|
+
*/
|
|
135
|
+
readDocTagList(node: ts.Declaration, name: string): string[] {
|
|
136
|
+
return this.readDocTag(node, name)
|
|
137
|
+
.flatMap(x => x.split(/\s*,\s*/g))
|
|
138
|
+
.map(x => x.replace(/`/g, ''))
|
|
139
|
+
.filter(x => !!x);
|
|
140
|
+
}
|
|
141
|
+
|
|
132
142
|
/**
|
|
133
143
|
* Import a decorator, generally to handle erasure
|
|
134
144
|
*/
|
package/src/util/doc.ts
CHANGED
|
@@ -44,7 +44,7 @@ export class DocUtil {
|
|
|
44
44
|
const docs = this.hasJSDoc(node) ? node.jsDoc : undefined;
|
|
45
45
|
|
|
46
46
|
if (docs) {
|
|
47
|
-
const top = docs
|
|
47
|
+
const top = docs.at(-1)!;
|
|
48
48
|
if (ts.isJSDoc(top)) {
|
|
49
49
|
out.description = this.getDocComment(top, out.description);
|
|
50
50
|
}
|