@@ -9,18 +9,18 @@ const time = new Time();
9
9
* $ node examples.js
10
10
*/
11
11
12
- function toRange ( min , max ) {
12
+ const toRange = ( min , max ) => {
13
13
let key = 'to-range' + min + max ;
14
14
time . start ( key ) ;
15
- let str = toRegexRange ( min , max , { wrap : false } ) ;
15
+
16
16
return [
17
17
'' ,
18
- '` toRegexRange(\'' + min + ', ' + max + '\')`' ,
19
- '`' + str . split ( '|' ) . join ( '\\|' ) + '`' ,
20
- '_' + time . end ( key ) + '_' ,
18
+ `\` toRegexRange(${ min } , ${ max } )\`` ,
19
+ `\` ${ toRegexRange ( min , max , { wrap : false } ) . split ( '|' ) . join ( '\\|' ) } \`` ,
20
+ `_ ${ time . end ( key ) } _` ,
21
21
''
22
22
] ;
23
- }
23
+ } ;
24
24
25
25
toRange ( '1' , '3' ) ;
26
26
@@ -30,22 +30,24 @@ let rows = [
30
30
] ;
31
31
32
32
let examples = [
33
- // ['0001', '5555'],
34
- // ['1', '5555'],
35
- // ['1', '555'],
36
- // ['1', '55'],
37
- // ['1', '50'],
38
-
39
- [ '5' , '5' ] ,
40
- [ '5' , '6' ] ,
41
- [ '29' , '51' ] ,
42
- [ '31' , '877' ] ,
43
- [ '111' , '555' ] ,
44
33
[ '-10' , '10' ] ,
45
34
[ '-100' , '-10' ] ,
46
35
[ '-100' , '100' ] ,
36
+
47
37
[ '001' , '100' ] ,
38
+ [ '001' , '555' ] ,
48
39
[ '0010' , '1000' ] ,
40
+
41
+ [ '1' , '50' ] ,
42
+ [ '1' , '55' ] ,
43
+ [ '1' , '555' ] ,
44
+ [ '1' , '5555' ] ,
45
+ [ '111' , '555' ] ,
46
+ [ '29' , '51' ] ,
47
+ [ '31' , '877' ] ,
48
+
49
+ [ '5' , '5' ] ,
50
+ [ '5' , '6' ] ,
49
51
[ '1' , '2' ] ,
50
52
[ '1' , '5' ] ,
51
53
[ '1' , '10' ] ,
@@ -55,7 +57,7 @@ let examples = [
55
57
[ '1' , '100000' ] ,
56
58
[ '1' , '1000000' ] ,
57
59
[ '1' , '10000000' ] ,
58
- ] . forEach ( function ( args ) {
60
+ ] . forEach ( args => {
59
61
rows . push ( toRange . apply ( null , args ) ) ;
60
62
} ) ;
61
63
@@ -67,8 +69,7 @@ console.log(text);
67
69
* by verb and used in the .verb.md readme template
68
70
*/
69
71
70
- module . exports = function ( ) {
71
- return text . split ( '\n' ) . map ( function ( line ) {
72
- return line . replace ( / ^ + / , '' ) ;
73
- } ) . join ( '\n' ) ;
72
+ module . exports = ( ) => {
73
+ return text . split ( '\n' ) . map ( line => line . replace ( / ^ + / , '' ) ) . join ( '\n' ) ;
74
74
} ;
75
+
0 commit comments