@@ -9,34 +9,34 @@ import { from } from './from'
99describe ( '@moeru/results' , ( ) => {
1010 // https://doc.rust-lang.org/std/option/enum.Option.html#examples-23
1111 it ( 'option.and' , ( ) => {
12- let a = some ( 2 )
13- let b : Option < string > = none
12+ const a = some ( 2 )
13+ const b : Option < string > = none
1414 expect ( and ( a , b ) ) . toStrictEqual ( none )
1515
16- let c : Option < number > = none
17- let d = some ( 'foo' )
16+ const c : Option < number > = none
17+ const d = some ( 'foo' )
1818 expect ( and ( c , d ) ) . toStrictEqual ( none )
1919
20- let e = some ( 2 )
21- let f = some ( 'foo' )
20+ const e = some ( 2 )
21+ const f = some ( 'foo' )
2222 expect ( and ( e , f ) ) . toStrictEqual ( some ( 'foo' ) )
2323
24- let g : Option < number > = none
25- let h : Option < string > = none
24+ const g : Option < number > = none
25+ const h : Option < string > = none
2626 expect ( and ( g , h ) ) . toStrictEqual ( none )
2727 } )
2828
2929 // https://doc.rust-lang.org/std/option/enum.Option.html#examples-24
3030 it ( 'option.andThen' , ( ) => {
31- let arr2D = [ [ 'A0' , 'A1' ] , [ 'B0' , 'B1' ] ]
32- let getArr2D = ( index : number ) => arr2D . at ( index )
31+ const arr2D = [ [ 'A0' , 'A1' ] , [ 'B0' , 'B1' ] ]
32+ const getArr2D = ( index : number ) => arr2D . at ( index )
3333 ? some ( arr2D [ index ] )
3434 : none
3535
36- let item01 = andThen ( getArr2D ( 0 ) , row => from ( row . at ( 1 ) ) )
36+ const item01 = andThen ( getArr2D ( 0 ) , row => from ( row . at ( 1 ) ) )
3737 expect ( item01 ) . toStrictEqual ( some ( 'A1' ) )
3838
39- let item20 = andThen ( getArr2D ( 2 ) , row => from ( row . at ( 0 ) ) )
39+ const item20 = andThen ( getArr2D ( 2 ) , row => from ( row . at ( 0 ) ) )
4040 expect ( item20 ) . toStrictEqual ( none )
4141 } )
4242} )
0 commit comments