@alloy-js/typescript 0.11.0 → 0.13.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/src/components/ClassDeclaration.d.ts +2 -0
  3. package/dist/src/components/ClassDeclaration.d.ts.map +1 -1
  4. package/dist/src/components/ClassDeclaration.js +14 -2
  5. package/dist/src/components/FunctionBase.d.ts.map +1 -1
  6. package/dist/src/components/FunctionBase.js +13 -3
  7. package/dist/src/components/FunctionType.d.ts +7 -8
  8. package/dist/src/components/FunctionType.d.ts.map +1 -1
  9. package/dist/src/components/FunctionType.js +29 -25
  10. package/dist/src/components/ImportStatement.d.ts.map +1 -1
  11. package/dist/src/components/ImportStatement.js +9 -2
  12. package/dist/src/components/Interface.d.ts +3 -2
  13. package/dist/src/components/Interface.d.ts.map +1 -1
  14. package/dist/src/components/Interface.js +8 -4
  15. package/dist/src/components/JSDocComment.js +1 -1
  16. package/dist/src/components/MemberDeclaration.d.ts +4 -0
  17. package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
  18. package/dist/src/components/MemberDeclaration.js +1 -1
  19. package/dist/src/components/MemberExpression.d.ts.map +1 -1
  20. package/dist/src/components/MemberExpression.js +3 -2
  21. package/dist/src/components/Reference.d.ts +8 -1
  22. package/dist/src/components/Reference.d.ts.map +1 -1
  23. package/dist/src/components/Reference.js +7 -2
  24. package/dist/src/components/TypeDeclaration.d.ts +1 -1
  25. package/dist/src/components/TypeDeclaration.d.ts.map +1 -1
  26. package/dist/src/components/TypeDeclaration.js +3 -2
  27. package/dist/src/components/TypeRefContext.d.ts +22 -0
  28. package/dist/src/components/TypeRefContext.d.ts.map +1 -0
  29. package/dist/src/components/TypeRefContext.js +41 -0
  30. package/dist/src/components/VarDeclaration.d.ts +1 -0
  31. package/dist/src/components/VarDeclaration.d.ts.map +1 -1
  32. package/dist/src/components/VarDeclaration.js +9 -3
  33. package/dist/src/components/index.d.ts +1 -0
  34. package/dist/src/components/index.d.ts.map +1 -1
  35. package/dist/src/components/index.js +1 -0
  36. package/dist/src/components/stc/index.d.ts +1 -0
  37. package/dist/src/components/stc/index.d.ts.map +1 -1
  38. package/dist/src/components/stc/index.js +1 -0
  39. package/dist/src/context/type-ref-context.d.ts +15 -0
  40. package/dist/src/context/type-ref-context.d.ts.map +1 -0
  41. package/dist/src/context/type-ref-context.js +12 -0
  42. package/dist/src/parameter-descriptor.d.ts +6 -0
  43. package/dist/src/parameter-descriptor.d.ts.map +1 -1
  44. package/dist/src/symbols/reference.d.ts +4 -1
  45. package/dist/src/symbols/reference.d.ts.map +1 -1
  46. package/dist/src/symbols/reference.js +11 -5
  47. package/dist/src/symbols/ts-module-scope.d.ts +4 -1
  48. package/dist/src/symbols/ts-module-scope.d.ts.map +1 -1
  49. package/dist/src/symbols/ts-module-scope.js +10 -3
  50. package/dist/src/symbols/ts-output-symbol.d.ts +2 -1
  51. package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -1
  52. package/dist/src/symbols/ts-output-symbol.js +1 -0
  53. package/dist/test/class.test.js +108 -5
  54. package/dist/test/enum-jsdoc.test.js +6 -6
  55. package/dist/test/function-declaration-jsdoc.test.js +3 -3
  56. package/dist/test/imports.test.d.ts.map +1 -1
  57. package/dist/test/imports.test.js +293 -2
  58. package/dist/test/interface-jsdoc.test.js +9 -9
  59. package/dist/test/jsdoc.test.js +5 -5
  60. package/dist/test/jsdocparam.test.js +8 -8
  61. package/dist/test/member-expression.test.js +218 -2
  62. package/dist/test/var-declaration-jsdoc.test.js +3 -3
  63. package/dist/test/var-declaration.test.js +1 -1
  64. package/dist/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +4 -4
  66. package/src/components/ClassDeclaration.tsx +19 -3
  67. package/src/components/FunctionBase.tsx +14 -3
  68. package/src/components/FunctionType.tsx +45 -40
  69. package/src/components/ImportStatement.tsx +30 -3
  70. package/src/components/Interface.tsx +41 -34
  71. package/src/components/JSDocComment.tsx +1 -1
  72. package/src/components/MemberDeclaration.tsx +7 -1
  73. package/src/components/MemberExpression.tsx +7 -2
  74. package/src/components/Reference.tsx +12 -2
  75. package/src/components/TypeDeclaration.tsx +16 -13
  76. package/src/components/TypeRefContext.tsx +49 -0
  77. package/src/components/VarDeclaration.tsx +6 -2
  78. package/src/components/index.ts +1 -0
  79. package/src/components/stc/index.ts +1 -0
  80. package/src/context/type-ref-context.tsx +19 -0
  81. package/src/parameter-descriptor.ts +7 -0
  82. package/src/symbols/reference.ts +17 -5
  83. package/src/symbols/ts-module-scope.ts +19 -4
  84. package/src/symbols/ts-output-symbol.ts +1 -0
  85. package/temp/api.json +613 -220
  86. package/test/class.test.tsx +75 -5
  87. package/test/enum-jsdoc.test.tsx +6 -6
  88. package/test/function-declaration-jsdoc.test.tsx +3 -3
  89. package/test/imports.test.tsx +215 -1
  90. package/test/interface-jsdoc.test.tsx +9 -9
  91. package/test/jsdoc.test.tsx +5 -5
  92. package/test/jsdocparam.test.tsx +8 -8
  93. package/test/member-expression.test.tsx +171 -2
  94. package/test/var-declaration-jsdoc.test.tsx +3 -3
  95. package/test/var-declaration.test.tsx +1 -1
@@ -1,4 +1,4 @@
1
- import { List, refkey, StatementList } from "@alloy-js/core";
1
+ import { List, Output, refkey, render, StatementList } from "@alloy-js/core";
2
2
  import "@alloy-js/core/testing";
3
3
  import { d } from "@alloy-js/core/testing";
4
4
  import { describe, expect, it } from "vitest";
@@ -162,6 +162,76 @@ describe("instance members", () => {
162
162
  }
163
163
  `);
164
164
  });
165
+
166
+ it("doesn't conflict with variables outside the class", () => {
167
+ const rk = refkey();
168
+ const res = toSourceText(
169
+ <List>
170
+ <ts.VarDeclaration name="one">1;</ts.VarDeclaration>
171
+ <ts.VarDeclaration name="two">2;</ts.VarDeclaration>
172
+ <ts.ClassDeclaration name="Foo">
173
+ <StatementList>
174
+ <ts.ClassField name="one" refkey={rk}>
175
+ 1
176
+ </ts.ClassField>
177
+ <ts.ClassMethod name="two">{rk} + 1</ts.ClassMethod>
178
+ </StatementList>
179
+ </ts.ClassDeclaration>
180
+ </List>,
181
+ );
182
+ expect(res).toEqual(d`
183
+ const one = 1;
184
+ const two = 2;
185
+ class Foo {
186
+ one = 1;
187
+ two() {
188
+ this.one + 1
189
+ };
190
+ }
191
+ `);
192
+ });
193
+
194
+ it("doesn't conflict with imports from other files", () => {
195
+ const rk1 = refkey();
196
+ const rk2 = refkey();
197
+ const tree = render(
198
+ <Output
199
+ nameConflictResolver={() => {
200
+ console.log("CONFLIT");
201
+ }}
202
+ >
203
+ <ts.SourceFile path="decl.ts">
204
+ <StatementList>
205
+ <ts.VarDeclaration export name="one" refkey={rk1}>
206
+ 1
207
+ </ts.VarDeclaration>
208
+ <ts.VarDeclaration export name="two" refkey={rk2}>
209
+ 2
210
+ </ts.VarDeclaration>
211
+ </StatementList>
212
+ </ts.SourceFile>
213
+ <ts.SourceFile path="ref.ts">
214
+ <ts.ClassDeclaration name="Foo">
215
+ <StatementList>
216
+ <ts.ClassField name="one">{rk1}</ts.ClassField>
217
+ <ts.ClassMethod name="two">{rk2}</ts.ClassMethod>
218
+ </StatementList>
219
+ </ts.ClassDeclaration>
220
+ </ts.SourceFile>
221
+ </Output>,
222
+ );
223
+
224
+ expect(tree.contents[1].contents).toEqual(d`
225
+ import { one, two } from "./decl.js";
226
+
227
+ class Foo {
228
+ one = one;
229
+ two() {
230
+ two
231
+ };
232
+ }
233
+ `);
234
+ });
165
235
  });
166
236
 
167
237
  describe("static members", () => {
@@ -309,15 +379,15 @@ it("renders a class with docs for the class and its members", () => {
309
379
  expect(res).toEqual(d`
310
380
  /**
311
381
  * This is a class documentation
312
- **/
382
+ */
313
383
  class Foo {
314
384
  /**
315
385
  * This is a field documentation
316
- **/
386
+ */
317
387
  bar = 123;
318
388
  /**
319
389
  * This is a method documentation
320
- **/
390
+ */
321
391
  baz() {
322
392
  return 123;
323
393
  }
@@ -353,7 +423,7 @@ it("renders a method with parameter docs", () => {
353
423
  * @param {string} b - Line 1 for b.
354
424
  * This is a long description that
355
425
  * should continue in the next line.
356
- **/
426
+ */
357
427
  bar(a: number, b: string): void {}
358
428
  }
359
429
  `);
@@ -19,7 +19,7 @@ it("renders an enum declaration with documentation", () => {
19
19
  expect(res).toEqual(d`
20
20
  /**
21
21
  * Color enumeration for the application
22
- **/
22
+ */
23
23
  enum Color {
24
24
  Red,
25
25
  Green,
@@ -49,25 +49,25 @@ it("renders an enum declaration with documented members", () => {
49
49
  expect(res).toEqual(d`
50
50
  /**
51
51
  * Represents cardinal directions. Used for navigation purposes
52
- **/
52
+ */
53
53
  enum Direction {
54
54
  /**
55
55
  * Bound to the north
56
- **/
56
+ */
57
57
  North = 0,
58
58
  /**
59
59
  * Bound to the East
60
60
  *
61
61
  * A second doc paragraph
62
- **/
62
+ */
63
63
  East = 1,
64
64
  /**
65
65
  * Opposite to North
66
- **/
66
+ */
67
67
  South = 2,
68
68
  /**
69
69
  * Going west!
70
- **/
70
+ */
71
71
  West = 3,
72
72
  }
73
73
  `);
@@ -18,7 +18,7 @@ it("renders a function declaration with documentation", () => {
18
18
  * A function that greets a person
19
19
  *
20
20
  * @param {string} name
21
- **/
21
+ */
22
22
  function greet(name: string): string {}
23
23
  `);
24
24
  });
@@ -42,7 +42,7 @@ it("With documented parameters", () => {
42
42
  *
43
43
  * @param {number} price
44
44
  * @param {number} [taxRate]
45
- **/
45
+ */
46
46
  export function calculateTotal(price: number, taxRate?: number): number {}
47
47
  `);
48
48
  });
@@ -84,6 +84,6 @@ it("renders a function with a reference", () => {
84
84
  * Creates a new user
85
85
  *
86
86
  * @param {User} user - The user object to create
87
- **/
87
+ */
88
88
  function createUser(user: User): void {}`);
89
89
  });
@@ -1,4 +1,5 @@
1
1
  import {
2
+ List,
2
3
  Output,
3
4
  SourceDirectory,
4
5
  StatementList,
@@ -6,9 +7,10 @@ import {
6
7
  render,
7
8
  } from "@alloy-js/core";
8
9
  import "@alloy-js/core/testing";
9
- import { it } from "vitest";
10
+ import { describe, it } from "vitest";
10
11
  import * as ts from "../src/components/index.js";
11
12
  import { Reference } from "../src/components/Reference.js";
13
+ import { TypeRefContext } from "../src/context/type-ref-context.js";
12
14
  import { tsNameConflictResolver } from "../src/name-conflict-resolver.js";
13
15
  import { assertFileContents } from "./utils.js";
14
16
 
@@ -171,6 +173,56 @@ it("works with default and named imports and name conflicts", () => {
171
173
  });
172
174
  });
173
175
 
176
+ it("works with importing the same name many times from different files with the default name conflict resolver", () => {
177
+ const rk1 = refkey();
178
+ const rk1i = refkey();
179
+ const rk2 = refkey();
180
+ const rk2i = refkey();
181
+ const rk3 = refkey();
182
+ const rk3i = refkey();
183
+
184
+ const res = render(
185
+ <Output>
186
+ <ts.SourceFile path="test1.ts">
187
+ <ts.VarDeclaration export name="conflict" refkey={rk1}>
188
+ "hi"
189
+ </ts.VarDeclaration>
190
+ <ts.InterfaceDeclaration export name="MyInterface" refkey={rk1i} />
191
+ </ts.SourceFile>
192
+ <ts.SourceFile path="test2.ts">
193
+ <ts.VarDeclaration name="conflict" refkey={rk2}>
194
+ "hi"
195
+ </ts.VarDeclaration>
196
+ <ts.InterfaceDeclaration export name="MyInterface" refkey={rk2i} />
197
+ </ts.SourceFile>
198
+ <ts.SourceFile path="test3.ts">
199
+ <ts.VarDeclaration name="conflict" refkey={rk3}>
200
+ "hi"
201
+ </ts.VarDeclaration>
202
+ <ts.InterfaceDeclaration export name="MyInterface" refkey={rk3i} />
203
+ </ts.SourceFile>
204
+ <ts.SourceFile path="test-import.ts">
205
+ <StatementList>
206
+ <ts.VarDeclaration name="one" type={rk1i} initializer={rk1} />
207
+ <ts.VarDeclaration name="two" type={rk2i} initializer={rk2} />
208
+ <ts.VarDeclaration name="three" type={rk3i} initializer={rk3} />
209
+ </StatementList>
210
+ </ts.SourceFile>
211
+ </Output>,
212
+ );
213
+
214
+ assertFileContents(res, {
215
+ "test-import.ts": `
216
+ import { type MyInterface, conflict } from "./test1.js";
217
+ import { type MyInterface as MyInterface_2, conflict as conflict_2 } from "./test2.js";
218
+ import { type MyInterface as MyInterface_3, conflict as conflict_3 } from "./test3.js";
219
+
220
+ const one: MyInterface = conflict;
221
+ const two: MyInterface_2 = conflict_2;
222
+ const three: MyInterface_3 = conflict_3;
223
+ `,
224
+ });
225
+ });
174
226
  it("works with default and named imports and name conflicts and references in nested scopes", () => {
175
227
  const res = render(
176
228
  <Output nameConflictResolver={tsNameConflictResolver}>
@@ -308,3 +360,165 @@ it("handles conflicts with local declarations", () => {
308
360
  `,
309
361
  });
310
362
  });
363
+
364
+ describe("type imports", () => {
365
+ function mkTestFile(name: string) {
366
+ const TypeA = refkey("TypeA");
367
+ const TypeB = refkey("TypeB");
368
+ const ClassA = refkey("ClassA");
369
+
370
+ return {
371
+ component: (
372
+ <ts.SourceFile path="test1.ts">
373
+ <ts.InterfaceDeclaration export name="TypeA" refkey={TypeA} />
374
+ <ts.InterfaceDeclaration export name="TypeB" refkey={TypeB} />
375
+ <ts.ClassDeclaration export name="ClassA" refkey={ClassA} />
376
+ </ts.SourceFile>
377
+ ),
378
+ TypeA,
379
+ TypeB,
380
+ ClassA,
381
+ };
382
+ }
383
+
384
+ it("adds type keyword only to type imports", () => {
385
+ const { component, TypeA, ClassA } = mkTestFile("test1.ts");
386
+ const res = render(
387
+ <Output>
388
+ {component}
389
+ <ts.SourceFile path="test2.ts">
390
+ <List>
391
+ <>
392
+ type A = <Reference refkey={TypeA} type />
393
+ </>
394
+ <>
395
+ class B extends <Reference refkey={ClassA} /> {"{}"}
396
+ </>
397
+ </List>
398
+ </ts.SourceFile>
399
+ </Output>,
400
+ );
401
+
402
+ assertFileContents(res, {
403
+ "test2.ts": `
404
+ import { type TypeA, ClassA } from "./test1.js";
405
+
406
+ type A = TypeA
407
+ class B extends ClassA {}
408
+ `,
409
+ });
410
+ });
411
+
412
+ it("add type keyword for whole import if all are types", () => {
413
+ const { component, TypeA, TypeB } = mkTestFile("test1.ts");
414
+ const res = render(
415
+ <Output>
416
+ {component}
417
+ <ts.SourceFile path="test2.ts">
418
+ <List>
419
+ <>
420
+ type A = <Reference refkey={TypeA} type />
421
+ </>
422
+ <>
423
+ type B = <Reference refkey={TypeB} type />
424
+ </>
425
+ </List>
426
+ </ts.SourceFile>
427
+ </Output>,
428
+ );
429
+
430
+ assertFileContents(res, {
431
+ "test2.ts": `
432
+ import type { TypeA, TypeB } from "./test1.js";
433
+
434
+ type A = TypeA
435
+ type B = TypeB
436
+ `,
437
+ });
438
+ });
439
+ it("reference same type multiple times", () => {
440
+ const { component, TypeA } = mkTestFile("test1.ts");
441
+ const res = render(
442
+ <Output>
443
+ {component}
444
+ <ts.SourceFile path="test2.ts">
445
+ <List>
446
+ <>
447
+ type A = <Reference refkey={TypeA} type />
448
+ </>
449
+ <>
450
+ type B = <Reference refkey={TypeA} type />
451
+ </>
452
+ </List>
453
+ </ts.SourceFile>
454
+ </Output>,
455
+ );
456
+
457
+ assertFileContents(res, {
458
+ "test2.ts": `
459
+ import type { TypeA } from "./test1.js";
460
+
461
+ type A = TypeA
462
+ type B = TypeA
463
+ `,
464
+ });
465
+ });
466
+
467
+ it("same reference used as both type and non type doesn't include type", () => {
468
+ const { component, ClassA } = mkTestFile("test1.ts");
469
+ const res = render(
470
+ <Output>
471
+ {component}
472
+ <ts.SourceFile path="test2.ts">
473
+ <List>
474
+ <>
475
+ type A = <Reference refkey={ClassA} type />
476
+ </>
477
+ <>
478
+ class B extends <Reference refkey={ClassA} /> {"{}"}
479
+ </>
480
+ </List>
481
+ </ts.SourceFile>
482
+ </Output>,
483
+ );
484
+
485
+ assertFileContents(res, {
486
+ "test2.ts": `
487
+ import { ClassA } from "./test1.js";
488
+
489
+ type A = ClassA
490
+ class B extends ClassA {}
491
+ `,
492
+ });
493
+ });
494
+
495
+ it("infer if a type reference from the typescript context", () => {
496
+ const { component, TypeA } = mkTestFile("test1.ts");
497
+ const res = render(
498
+ <Output>
499
+ {component}
500
+ <ts.SourceFile path="test2.ts">
501
+ <TypeRefContext.Provider value={{ type: true }}>
502
+ <List>
503
+ <>
504
+ type A = <Reference refkey={TypeA} />
505
+ </>
506
+ <>
507
+ type B = <Reference refkey={TypeA} />
508
+ </>
509
+ </List>
510
+ </TypeRefContext.Provider>
511
+ </ts.SourceFile>
512
+ </Output>,
513
+ );
514
+
515
+ assertFileContents(res, {
516
+ "test2.ts": `
517
+ import type { TypeA } from "./test1.js";
518
+
519
+ type A = TypeA
520
+ type B = TypeA
521
+ `,
522
+ });
523
+ });
524
+ });
@@ -19,7 +19,7 @@ it("renders an interface declaration with documentation", () => {
19
19
  expect(res).toEqual(d`
20
20
  /**
21
21
  * Interface representing a person
22
- **/
22
+ */
23
23
  interface Person {
24
24
  name: string;
25
25
  age: number;
@@ -42,7 +42,7 @@ it("renders an interface declaration with docs from a string array with single e
42
42
  expect(res).toEqual(d`
43
43
  /**
44
44
  * Interface representing a person
45
- **/
45
+ */
46
46
  interface Person {
47
47
  name: string;
48
48
  age: number;
@@ -70,7 +70,7 @@ it("renders an interface declaration with docs from a string array", () => {
70
70
  * Interface representing a person
71
71
  *
72
72
  * This should be another paragraph
73
- **/
73
+ */
74
74
  interface Person {
75
75
  name: string;
76
76
  age: number;
@@ -103,15 +103,15 @@ it("renders an interface declaration with documented properties", () => {
103
103
  expect(res).toEqual(d`
104
104
  /**
105
105
  * Standard API response format
106
- **/
106
+ */
107
107
  export interface APIResponse {
108
108
  /**
109
109
  * Wether or not the request completed successfully
110
- **/
110
+ */
111
111
  success: boolean;
112
112
  /**
113
113
  * the response payload
114
- **/
114
+ */
115
115
  data: unknown;
116
116
  error?: string;
117
117
  }
@@ -146,17 +146,17 @@ it("renders an interface declaration with array documented properties ", () => {
146
146
  expect(res).toEqual(d`
147
147
  /**
148
148
  * Standard API response format
149
- **/
149
+ */
150
150
  export interface APIResponse {
151
151
  /**
152
152
  * Wether or not the request completed successfully
153
153
  *
154
154
  * This is another paragraph
155
- **/
155
+ */
156
156
  success: boolean;
157
157
  /**
158
158
  * the response payload
159
- **/
159
+ */
160
160
  data: unknown;
161
161
  error?: string;
162
162
  }
@@ -24,7 +24,7 @@ describe("JSDoc", () => {
24
24
  * Hello!
25
25
  *
26
26
  * This is another line
27
- **/
27
+ */
28
28
  `,
29
29
  { printWidth: 40 },
30
30
  );
@@ -59,7 +59,7 @@ describe("Prose", () => {
59
59
  * This is another paragraph. There
60
60
  * should be a couple breaks in front of
61
61
  * it.
62
- **/
62
+ */
63
63
  `,
64
64
  { printWidth: 40 },
65
65
  );
@@ -83,7 +83,7 @@ describe("JSDocExample", () => {
83
83
  *
84
84
  * @example
85
85
  * console.log("Hello world!")
86
- **/
86
+ */
87
87
  `,
88
88
  { printWidth: 40 },
89
89
  );
@@ -109,7 +109,7 @@ describe("JSDocExample", () => {
109
109
  * \`\`\`ts
110
110
  * console.log("Hello world!")
111
111
  * \`\`\`
112
- **/
112
+ */
113
113
  `,
114
114
  { printWidth: 40 },
115
115
  );
@@ -140,7 +140,7 @@ describe("JSDocExample", () => {
140
140
  * @example
141
141
  * // make a function call.
142
142
  * console.log(arg1, arg2);
143
- **/
143
+ */
144
144
  `,
145
145
  { printWidth: 40 },
146
146
  );
@@ -14,7 +14,7 @@ it("name only", () => {
14
14
  d`
15
15
  /**
16
16
  * @param somebody
17
- **/
17
+ */
18
18
  `,
19
19
  );
20
20
  });
@@ -30,7 +30,7 @@ it("name and type", () => {
30
30
  d`
31
31
  /**
32
32
  * @param {string} somebody
33
- **/
33
+ */
34
34
  `,
35
35
  );
36
36
  });
@@ -48,7 +48,7 @@ it("name, type and description", () => {
48
48
  d`
49
49
  /**
50
50
  * @param {string} somebody Somebody's name.
51
- **/
51
+ */
52
52
  `,
53
53
  );
54
54
  });
@@ -66,7 +66,7 @@ it("name, type and description with hyphen", () => {
66
66
  d`
67
67
  /**
68
68
  * @param {string} somebody - Somebody's name.
69
- **/
69
+ */
70
70
  `,
71
71
  );
72
72
  });
@@ -84,7 +84,7 @@ it("name, type, description, hyphen and optional", () => {
84
84
  d`
85
85
  /**
86
86
  * @param {string} [somebody] - Somebody's name.
87
- **/
87
+ */
88
88
  `,
89
89
  );
90
90
  });
@@ -108,7 +108,7 @@ it("name, type, description, hyphen and optional with default value", () => {
108
108
  d`
109
109
  /**
110
110
  * @param {string} [somebody=John Doe] - Somebody's name.
111
- **/
111
+ */
112
112
  `,
113
113
  );
114
114
  });
@@ -153,7 +153,7 @@ it("name, type, description, hyphen and optional with default value with a very
153
153
  * even a codename (e.g., "Agent X"). It's used primarily for display
154
154
  * purposes, logging, or greeting messages and is not required to be unique or
155
155
  * validated unless specified by the caller.
156
- **/
156
+ */
157
157
  `,
158
158
  { printWidth: 80 },
159
159
  );
@@ -181,7 +181,7 @@ it("name, type, description, hyphen and optional with default value with a descr
181
181
  /**
182
182
  * @param {string} [somebody=John Doe] - Somebody's name. This is one line
183
183
  * This is another line
184
- **/
184
+ */
185
185
  `,
186
186
  { printWidth: 80 },
187
187
  );