bio-dts 0.15.2 → 0.16.0
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/lib/post-transform.js +12 -2
- package/package.json +10 -10
package/lib/post-transform.js
CHANGED
|
@@ -409,7 +409,7 @@ export default function transform(src, transformOptions = {}) {
|
|
|
409
409
|
const returnTags = tags.filter(t => t.name === 'return' || t.name === 'returns');
|
|
410
410
|
|
|
411
411
|
if (returnTags.length > 1) {
|
|
412
|
-
throw error(hostPath.value,
|
|
412
|
+
throw error(hostPath.value, `must specify zero or one @return(s) in JSDoc - found ${returnTags.length}`);
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
return [
|
|
@@ -502,6 +502,14 @@ declare function p${
|
|
|
502
502
|
return replacements;
|
|
503
503
|
}
|
|
504
504
|
|
|
505
|
+
/**
|
|
506
|
+
* Clean the given (JSDoc) comment node - strip what is not necessary in
|
|
507
|
+
* type declarations: remove JSDoc only annotations, fixup type parameters.
|
|
508
|
+
*
|
|
509
|
+
* @param {any} comment - the comment node
|
|
510
|
+
*
|
|
511
|
+
* @return {any|null} - the cleaned comment node or null if it shall be dropped
|
|
512
|
+
*/
|
|
505
513
|
function cleanComment(comment) {
|
|
506
514
|
|
|
507
515
|
/**
|
|
@@ -566,11 +574,13 @@ declare function p${
|
|
|
566
574
|
}
|
|
567
575
|
|
|
568
576
|
/**
|
|
577
|
+
* Cleans comments on the given node - strip what is not necessary
|
|
578
|
+
* in type declarations.
|
|
579
|
+
*
|
|
569
580
|
* @param { Path<any> } nodePath
|
|
570
581
|
*/
|
|
571
582
|
function cleanComments(nodePath) {
|
|
572
583
|
|
|
573
|
-
// clean JSDoc comments: remove annotation, fixup type parameters
|
|
574
584
|
const comments = nodePath.get('comments') || { value: [] };
|
|
575
585
|
|
|
576
586
|
for (const key of keys(comments.value || []).reverse()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bio-dts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Generate sane and clean types from JavaScript sources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./bin/cmd.js",
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
"author": "Nico Rehwaldt",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/parser": "^7.29.
|
|
32
|
+
"@babel/parser": "^7.29.9",
|
|
33
33
|
"@jridgewell/remapping": "^2.3.5",
|
|
34
34
|
"@jridgewell/source-map": "^0.3.11",
|
|
35
|
-
"recast": "^0.
|
|
35
|
+
"recast": "^0.24.0",
|
|
36
36
|
"tiny-glob": "^0.2.9"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/types": "^7.29.
|
|
39
|
+
"@babel/types": "^7.29.8",
|
|
40
40
|
"@types/mocha": "^10.0.10",
|
|
41
|
-
"@types/node": "^24.13.
|
|
41
|
+
"@types/node": "^24.13.6",
|
|
42
42
|
"chai": "^6.2.2",
|
|
43
|
-
"eslint": "^9.39.
|
|
44
|
-
"eslint-plugin-bpmn-io": "^2.
|
|
45
|
-
"mocha": "^
|
|
46
|
-
"npm-run-all2": "^9.0.
|
|
47
|
-
"typescript": "^
|
|
43
|
+
"eslint": "^9.39.5",
|
|
44
|
+
"eslint-plugin-bpmn-io": "^2.4.0",
|
|
45
|
+
"mocha": "^12.0.2",
|
|
46
|
+
"npm-run-all2": "^9.0.3",
|
|
47
|
+
"typescript": "^6.0.3"
|
|
48
48
|
},
|
|
49
49
|
"sideEffects": false,
|
|
50
50
|
"files": [
|