File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { range } from "linq-to-typescript"
1+ const promise = import ( "linq-to-typescript" )
22
3- const primeNumbers = range ( 2 , 10000 )
3+ promise . then ( ( { range} ) => {
4+ const primeNumbers = range ( 2 , 10000 )
45 . select ( ( i ) => [ i , Math . floor ( Math . sqrt ( i ) ) ] )
56 . where ( ( [ i , iSq ] ) =>
67 range ( 2 , iSq ) . all ( ( j ) => i % j !== 0 ) )
78 . select ( ( [ prime ] ) => prime )
89 . toArray ( )
910
10- async function asyncIterable ( ) {
11- for await ( const i of range ( 0 , 10 ) . selectAsync ( async ( x ) => x * 2 ) ) {
12- console . log ( i )
11+ async function asyncIterable ( ) {
12+ for await ( const i of range ( 0 , 10 ) . selectAsync ( async ( x ) => x * 2 ) ) {
13+ console . log ( i )
14+ }
1315 }
14- }
1516
16- asyncIterable ( )
17- console . log ( primeNumbers )
17+ asyncIterable ( )
18+ console . log ( primeNumbers )
19+ } )
Original file line number Diff line number Diff line change 11{
22 "compileOnSave" : true ,
33 "compilerOptions" : {
4- "moduleResolution" : " node " ,
5- "target" : " es2019 " ,
4+ "moduleResolution" : " Node16 " ,
5+ "target" : " ES2022 " ,
66 "module" : " commonjs" ,
77 "esModuleInterop" : true ,
88 "removeComments" : true ,
1616 "declaration" : false ,
1717 "lib" : [
1818 " dom" ,
19- " es2019 "
19+ " ES2022 "
2020 ],
2121 }
2222}
You can’t perform that action at this time.
0 commit comments