File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -10,25 +10,27 @@ is important, because the JSON will be much more compact.
10
10
11
11
Here's an example of a tuple definition in TypeScript:
12
12
13
- ``` typescript
13
+ <!-- this code block uses four backticks ```` to workaround https://github.com/Kotlin/kotlinx-knit/issues/57 -->
14
+
15
+ ```` typescript
14
16
type StringNumberPair = [str : string , num : number ];
15
- ```
17
+ ````
16
18
17
19
This would get serialized to a JSON array
18
20
19
- [ // ] : # ( @formatter:off )
21
+ <!-- - @formatter:off -->
20
22
``` json
21
23
[" some string value" , 123 ]
22
24
```
23
- [ // ] : # ( @formatter:on )
25
+ <!-- - @formatter:on -->
24
26
25
27
which is more compact than an equivalent JSON object, which requires property names.
26
28
27
- [ // ] : # ( @formatter:off )
29
+ <!-- - @formatter:off -->
28
30
``` json
29
31
{ "str" : " some string value" , "num" : 123 }
30
32
```
31
- [ // ] : # ( @formatter:on )
33
+ <!-- - @formatter:on -->
32
34
33
35
## Tuples in KxsTsGen
34
36
You can’t perform that action at this time.
0 commit comments