File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
var jmespath = require ( './jmespath' )
2
- var parser = new jmespath . Parser ( ) ;
3
2
var Benchmark = require ( 'benchmark' ) ;
4
3
var suite = new Benchmark . Suite ;
5
4
6
5
// add tests
7
6
suite . add ( 'Parser#single_expr' , function ( ) {
8
- parser . parse ( "foo" ) ;
7
+ jmespath . compile ( "foo" ) ;
9
8
} )
10
9
. add ( 'Parser#single_subexpr' , function ( ) {
11
- parser . parse ( "foo.bar" ) ;
10
+ jmespath . compile ( "foo.bar" ) ;
12
11
} )
13
12
. add ( 'Parser#deeply_nested_50' , function ( ) {
14
- parser . parse ( "j49.j48.j47.j46.j45.j44.j43.j42.j41.j40.j39.j38.j37.j36.j35.j34.j33.j32.j31.j30.j29.j28.j27.j26.j25.j24.j23.j22.j21.j20.j19.j18.j17.j16.j15.j14.j13.j12.j11.j10.j9.j8.j7.j6.j5.j4.j3.j2.j1.j0" ) ;
13
+ jmespath . compile ( "j49.j48.j47.j46.j45.j44.j43.j42.j41.j40.j39.j38.j37.j36.j35.j34.j33.j32.j31.j30.j29.j28.j27.j26.j25.j24.j23.j22.j21.j20.j19.j18.j17.j16.j15.j14.j13.j12.j11.j10.j9.j8.j7.j6.j5.j4.j3.j2.j1.j0" ) ;
15
14
16
15
} )
17
16
. add ( 'Parser#deeply_nested_50_index' , function ( ) {
18
- parser . parse ( "[49][48][47][46][45][44][43][42][41][40][39][38][37][36][35][34][33][32][31][30][29][28][27][26][25][24][23][22][21][20][19][18][17][16][15][14][13][12][11][10][9][8][7][6][5][4][3][2][1][0]" ) ;
17
+ jmespath . compile ( "[49][48][47][46][45][44][43][42][41][40][39][38][37][36][35][34][33][32][31][30][29][28][27][26][25][24][23][22][21][20][19][18][17][16][15][14][13][12][11][10][9][8][7][6][5][4][3][2][1][0]" ) ;
19
18
} )
20
19
. add ( 'Parser#basic_list_projection' , function ( ) {
21
- parser . parse ( "foo[*].bar" ) ;
20
+ jmespath . compile ( "foo[*].bar" ) ;
22
21
} )
23
22
. on ( 'cycle' , function ( event ) {
24
23
var bench = event . target ;
You can’t perform that action at this time.
0 commit comments