File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -57,21 +57,21 @@ describe(`Store utils`, () => {
57
57
58
58
describe ( `compose()` , ( ) => {
59
59
const cube = ( n : number ) => Math . pow ( n , 3 ) ;
60
- const precision = ( n : number ) => parseFloat ( n . toPrecision ( 12 ) ) ;
61
- const addPtTwo = ( n : number ) => n + 0. 2;
60
+ const multiplyByFive = ( n : number ) => n * 5 ;
61
+ const addTwo = ( n : number ) => n + 2 ;
62
62
63
63
it ( `should compose functions` , ( ) => {
64
- const addPrecision = compose (
65
- precision ,
66
- addPtTwo
64
+ const add2AndMultiply5 = compose (
65
+ multiplyByFive ,
66
+ addTwo
67
67
) ;
68
- const addPrecisionCubed = compose (
68
+ const add2AndMultiply5Cubed = compose (
69
69
cube ,
70
- addPrecision
70
+ add2AndMultiply5
71
71
) ;
72
72
73
- expect ( addPrecision ( 0. 1) ) . toBe ( 0.3 ) ;
74
- expect ( addPrecisionCubed ( 0.1 ) ) . toBe ( 0.027 ) ;
73
+ expect ( add2AndMultiply5 ( 1 ) ) . toBe ( 15 ) ;
74
+ expect ( add2AndMultiply5Cubed ( 2 ) ) . toBe ( 8000 ) ;
75
75
} ) ;
76
76
77
77
it ( `should act as identity if no functions passed` , ( ) => {
Original file line number Diff line number Diff line change 39
39
"publish:latest" : " ts-node ./build/publish-latest.ts"
40
40
},
41
41
"engines" : {
42
- "node" : " >=10.9.0 <=11 .12.0" ,
42
+ "node" : " >=10.9.0 <=12 .12.0" ,
43
43
"npm" : " >=5.3.0" ,
44
44
"yarn" : " >=1.9.2 <2.0.0"
45
45
},
You can’t perform that action at this time.
0 commit comments