add test that the new Object.groupBy method has a type

This commit is contained in:
erik-krogh
2024-03-12 13:22:11 +01:00
parent 9f410eb2d6
commit 95a5ec7f27
3 changed files with 124 additions and 8 deletions

View File

@@ -125,6 +125,8 @@ nodes
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
@@ -1760,8 +1762,8 @@ nodes
| tst.ts:483:46:483:50 | [LocalTypeAccess] Pair3 | semmle.label | [LocalTypeAccess] Pair3 |
| tst.ts:483:46:483:58 | [GenericTypeExpr] Pair3<string> | semmle.label | [GenericTypeExpr] Pair3<string> |
| tst.ts:483:52:483:57 | [KeywordTypeExpr] string | semmle.label | [KeywordTypeExpr] string |
| tst.ts:486:1:492:1 | [NamespaceDeclaration] module ... ow"); } | semmle.label | [NamespaceDeclaration] module ... ow"); } |
| tst.ts:486:1:492:1 | [NamespaceDeclaration] module ... ow"); } | semmle.order | 90 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | semmle.label | [NamespaceDeclaration] module ... }); } |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | semmle.order | 90 |
| tst.ts:486:8:486:11 | [VarDecl] TS54 | semmle.label | [VarDecl] TS54 |
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | semmle.label | [FunctionDeclStmt] functio ... 0]; } |
| tst.ts:487:12:487:28 | [VarDecl] createStreetLight | semmle.label | [VarDecl] createStreetLight |
@@ -1788,6 +1790,33 @@ nodes
| tst.ts:491:29:491:36 | [Literal] "yellow" | semmle.label | [Literal] "yellow" |
| tst.ts:491:39:491:45 | [Literal] "green" | semmle.label | [Literal] "green" |
| tst.ts:491:49:491:56 | [Literal] "yellow" | semmle.label | [Literal] "yellow" |
| tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | semmle.label | [DeclStmt] const myObj = ... |
| tst.ts:493:9:493:13 | [VarDecl] myObj | semmle.label | [VarDecl] myObj |
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | semmle.label | [VariableDeclarator] myObj = ... "; }) |
| tst.ts:493:17:493:22 | [VarRef] Object | semmle.label | [VarRef] Object |
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | semmle.label | [DotExpr] Object.groupBy |
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | semmle.label | [MethodCallExpr] Object. ... "; }) |
| tst.ts:493:24:493:30 | [Label] groupBy | semmle.label | [Label] groupBy |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | semmle.label | [ArrayExpr] [0, 1, 2, 3, 4, 5] |
| tst.ts:493:33:493:33 | [Literal] 0 | semmle.label | [Literal] 0 |
| tst.ts:493:36:493:36 | [Literal] 1 | semmle.label | [Literal] 1 |
| tst.ts:493:39:493:39 | [Literal] 2 | semmle.label | [Literal] 2 |
| tst.ts:493:42:493:42 | [Literal] 3 | semmle.label | [Literal] 3 |
| tst.ts:493:45:493:45 | [Literal] 4 | semmle.label | [Literal] 4 |
| tst.ts:493:48:493:48 | [Literal] 5 | semmle.label | [Literal] 5 |
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | semmle.label | [ArrowFunctionExpr] (num, i ... d"; } |
| tst.ts:493:53:493:55 | [SimpleParameter] num | semmle.label | [SimpleParameter] num |
| tst.ts:493:58:493:62 | [SimpleParameter] index | semmle.label | [SimpleParameter] index |
| tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | semmle.label | [BlockStmt] { r ... d"; } |
| tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | semmle.label | [ReturnStmt] return ... "odd"; |
| tst.ts:494:12:494:14 | [VarRef] num | semmle.label | [VarRef] num |
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | semmle.label | [BinaryExpr] num % 2 |
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | semmle.label | [BinaryExpr] num % 2 === 0 |
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | semmle.label | [ConditionalExpr] num % 2 ... : "odd" |
| tst.ts:494:18:494:18 | [Literal] 2 | semmle.label | [Literal] 2 |
| tst.ts:494:24:494:24 | [Literal] 0 | semmle.label | [Literal] 0 |
| tst.ts:494:28:494:33 | [Literal] "even" | semmle.label | [Literal] "even" |
| tst.ts:494:36:494:40 | [Literal] "odd" | semmle.label | [Literal] "odd" |
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.label | [ExportDeclaration] export ... 'b'; } |
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.order | 91 |
| tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.label | [FunctionDeclStmt] functio ... 'b'; } |
@@ -2251,6 +2280,10 @@ edges
| file://:0:0:0:0 | (Arguments) | tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | semmle.order | 0 |
| file://:0:0:0:0 | (Arguments) | tst.ts:491:49:491:56 | [Literal] "yellow" | semmle.label | 1 |
| file://:0:0:0:0 | (Arguments) | tst.ts:491:49:491:56 | [Literal] "yellow" | semmle.order | 1 |
| file://:0:0:0:0 | (Arguments) | tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | semmle.label | 0 |
| file://:0:0:0:0 | (Arguments) | tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | semmle.order | 0 |
| file://:0:0:0:0 | (Arguments) | tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | semmle.label | 1 |
| file://:0:0:0:0 | (Arguments) | tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | semmle.order | 1 |
| file://:0:0:0:0 | (Parameters) | tst.ts:14:17:14:17 | [SimpleParameter] x | semmle.label | 0 |
| file://:0:0:0:0 | (Parameters) | tst.ts:14:17:14:17 | [SimpleParameter] x | semmle.order | 0 |
| file://:0:0:0:0 | (Parameters) | tst.ts:14:28:14:28 | [SimpleParameter] y | semmle.label | 1 |
@@ -2353,6 +2386,10 @@ edges
| file://:0:0:0:0 | (Parameters) | tst.ts:487:48:487:53 | [SimpleParameter] colors | semmle.order | 0 |
| file://:0:0:0:0 | (Parameters) | tst.ts:487:61:487:72 | [SimpleParameter] defaultColor | semmle.label | 1 |
| file://:0:0:0:0 | (Parameters) | tst.ts:487:61:487:72 | [SimpleParameter] defaultColor | semmle.order | 1 |
| file://:0:0:0:0 | (Parameters) | tst.ts:493:53:493:55 | [SimpleParameter] num | semmle.label | 0 |
| file://:0:0:0:0 | (Parameters) | tst.ts:493:53:493:55 | [SimpleParameter] num | semmle.order | 0 |
| file://:0:0:0:0 | (Parameters) | tst.ts:493:58:493:62 | [SimpleParameter] index | semmle.label | 1 |
| file://:0:0:0:0 | (Parameters) | tst.ts:493:58:493:62 | [SimpleParameter] index | semmle.order | 1 |
| file://:0:0:0:0 | (Parameters) | type_alias.ts:14:10:14:17 | [SimpleParameter] property | semmle.label | 0 |
| file://:0:0:0:0 | (Parameters) | type_alias.ts:14:10:14:17 | [SimpleParameter] property | semmle.order | 0 |
| file://:0:0:0:0 | (Parameters) | type_alias.ts:21:19:21:21 | [SimpleParameter] key | semmle.label | 0 |
@@ -5223,12 +5260,14 @@ edges
| tst.ts:483:46:483:58 | [GenericTypeExpr] Pair3<string> | tst.ts:483:46:483:50 | [LocalTypeAccess] Pair3 | semmle.order | 1 |
| tst.ts:483:46:483:58 | [GenericTypeExpr] Pair3<string> | tst.ts:483:52:483:57 | [KeywordTypeExpr] string | semmle.label | 2 |
| tst.ts:483:46:483:58 | [GenericTypeExpr] Pair3<string> | tst.ts:483:52:483:57 | [KeywordTypeExpr] string | semmle.order | 2 |
| tst.ts:486:1:492:1 | [NamespaceDeclaration] module ... ow"); } | tst.ts:486:8:486:11 | [VarDecl] TS54 | semmle.label | 1 |
| tst.ts:486:1:492:1 | [NamespaceDeclaration] module ... ow"); } | tst.ts:486:8:486:11 | [VarDecl] TS54 | semmle.order | 1 |
| tst.ts:486:1:492:1 | [NamespaceDeclaration] module ... ow"); } | tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | semmle.label | 2 |
| tst.ts:486:1:492:1 | [NamespaceDeclaration] module ... ow"); } | tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | semmle.order | 2 |
| tst.ts:486:1:492:1 | [NamespaceDeclaration] module ... ow"); } | tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | semmle.label | 3 |
| tst.ts:486:1:492:1 | [NamespaceDeclaration] module ... ow"); } | tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | semmle.order | 3 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:486:8:486:11 | [VarDecl] TS54 | semmle.label | 1 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:486:8:486:11 | [VarDecl] TS54 | semmle.order | 1 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | semmle.label | 2 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | semmle.order | 2 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | semmle.label | 3 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | semmle.order | 3 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | semmle.label | 4 |
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | semmle.order | 4 |
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | file://:0:0:0:0 | (Parameters) | semmle.label | 1 |
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | file://:0:0:0:0 | (Parameters) | semmle.order | 1 |
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | file://:0:0:0:0 | (TypeParameters) | semmle.label | 2 |
@@ -5271,6 +5310,54 @@ edges
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:29:491:36 | [Literal] "yellow" | semmle.order | 2 |
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:39:491:45 | [Literal] "green" | semmle.label | 3 |
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:39:491:45 | [Literal] "green" | semmle.order | 3 |
| tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | semmle.label | 1 |
| tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | semmle.order | 1 |
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | tst.ts:493:9:493:13 | [VarDecl] myObj | semmle.label | 1 |
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | tst.ts:493:9:493:13 | [VarDecl] myObj | semmle.order | 1 |
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | semmle.label | 2 |
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | semmle.order | 2 |
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | tst.ts:493:17:493:22 | [VarRef] Object | semmle.label | 1 |
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | tst.ts:493:17:493:22 | [VarRef] Object | semmle.order | 1 |
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | tst.ts:493:24:493:30 | [Label] groupBy | semmle.label | 2 |
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | tst.ts:493:24:493:30 | [Label] groupBy | semmle.order | 2 |
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | file://:0:0:0:0 | (Arguments) | semmle.label | 1 |
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | file://:0:0:0:0 | (Arguments) | semmle.order | 1 |
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | semmle.label | 0 |
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | semmle.order | 0 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:33:493:33 | [Literal] 0 | semmle.label | 1 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:33:493:33 | [Literal] 0 | semmle.order | 1 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:36:493:36 | [Literal] 1 | semmle.label | 2 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:36:493:36 | [Literal] 1 | semmle.order | 2 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:39:493:39 | [Literal] 2 | semmle.label | 3 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:39:493:39 | [Literal] 2 | semmle.order | 3 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:42:493:42 | [Literal] 3 | semmle.label | 4 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:42:493:42 | [Literal] 3 | semmle.order | 4 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:45:493:45 | [Literal] 4 | semmle.label | 5 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:45:493:45 | [Literal] 4 | semmle.order | 5 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:48:493:48 | [Literal] 5 | semmle.label | 6 |
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:48:493:48 | [Literal] 5 | semmle.order | 6 |
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | file://:0:0:0:0 | (Parameters) | semmle.label | 1 |
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | file://:0:0:0:0 | (Parameters) | semmle.order | 1 |
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | semmle.label | 5 |
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | semmle.order | 5 |
| tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | semmle.label | 1 |
| tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | semmle.order | 1 |
| tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | semmle.label | 1 |
| tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | semmle.order | 1 |
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | tst.ts:494:12:494:14 | [VarRef] num | semmle.label | 1 |
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | tst.ts:494:12:494:14 | [VarRef] num | semmle.order | 1 |
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | tst.ts:494:18:494:18 | [Literal] 2 | semmle.label | 2 |
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | tst.ts:494:18:494:18 | [Literal] 2 | semmle.order | 2 |
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | semmle.label | 1 |
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | semmle.order | 1 |
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | tst.ts:494:24:494:24 | [Literal] 0 | semmle.label | 2 |
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | tst.ts:494:24:494:24 | [Literal] 0 | semmle.order | 2 |
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | semmle.label | 1 |
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | semmle.order | 1 |
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:28:494:33 | [Literal] "even" | semmle.label | 2 |
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:28:494:33 | [Literal] "even" | semmle.order | 2 |
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:36:494:40 | [Literal] "odd" | semmle.label | 3 |
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:36:494:40 | [Literal] "odd" | semmle.order | 3 |
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.label | 1 |
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.order | 1 |
| tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | tstModuleCJS.cts:1:17:1:28 | [VarDecl] tstModuleCJS | semmle.label | 0 |

View File

@@ -669,6 +669,29 @@ getExprType
| tst.ts:491:29:491:36 | "yellow" | "yellow" |
| tst.ts:491:39:491:45 | "green" | "green" |
| tst.ts:491:49:491:56 | "yellow" | "yellow" |
| tst.ts:493:9:493:13 | myObj | Partial<Record<"even" \| "odd", number[]>> |
| tst.ts:493:17:493:22 | Object | ObjectConstructor |
| tst.ts:493:17:493:30 | Object.groupBy | <K extends PropertyKey, T>(items: Iterable<T>, ... |
| tst.ts:493:17:495:4 | Object. ... ";\\n }) | Partial<Record<"even" \| "odd", number[]>> |
| tst.ts:493:24:493:30 | groupBy | <K extends PropertyKey, T>(items: Iterable<T>, ... |
| tst.ts:493:32:493:49 | [0, 1, 2, 3, 4, 5] | Iterable<number> |
| tst.ts:493:33:493:33 | 0 | 0 |
| tst.ts:493:36:493:36 | 1 | 1 |
| tst.ts:493:39:493:39 | 2 | 2 |
| tst.ts:493:42:493:42 | 3 | 3 |
| tst.ts:493:45:493:45 | 4 | 4 |
| tst.ts:493:48:493:48 | 5 | 5 |
| tst.ts:493:52:495:3 | (num, i ... d";\\n } | (num: number, index: number) => "even" \| "odd" |
| tst.ts:493:53:493:55 | num | number |
| tst.ts:493:58:493:62 | index | number |
| tst.ts:494:12:494:14 | num | number |
| tst.ts:494:12:494:18 | num % 2 | number |
| tst.ts:494:12:494:24 | num % 2 === 0 | boolean |
| tst.ts:494:12:494:40 | num % 2 ... : "odd" | "even" \| "odd" |
| tst.ts:494:18:494:18 | 2 | 2 |
| tst.ts:494:24:494:24 | 0 | 0 |
| tst.ts:494:28:494:33 | "even" | "even" |
| tst.ts:494:36:494:40 | "odd" | "odd" |
| tstModuleCJS.cts:1:17:1:28 | tstModuleCJS | () => "a" \| "b" |
| tstModuleCJS.cts:2:12:2:15 | Math | Math |
| tstModuleCJS.cts:2:12:2:22 | Math.random | () => number |
@@ -1374,6 +1397,7 @@ unionIndex
| "boolean" | 3 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
| "c" | 2 | "a" \| "b" \| "c" |
| "circle" | 0 | "circle" \| "square" |
| "even" | 0 | "even" \| "odd" |
| "function" | 7 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
| "green" | 1 | "red" \| "green" \| "blue" |
| "green" | 1 | "red" \| "green" \| "yellow" |
@@ -1381,6 +1405,7 @@ unionIndex
| "number" | 1 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
| "number" | 1 | keyof TypeMap |
| "object" | 6 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
| "odd" | 1 | "even" \| "odd" |
| "red" | 0 | "red" \| "green" \| "blue" |
| "red" | 0 | "red" \| "green" \| "yellow" |
| "square" | 1 | "circle" \| "square" |

View File

@@ -489,4 +489,8 @@ module TS54 {
}
createStreetLight(["red", "yellow", "green"], "yellow");
const myObj = Object.groupBy([0, 1, 2, 3, 4, 5], (num, index) => {
return num % 2 === 0 ? "even": "odd";
});
}