@@ -31,7 +31,7 @@ let searchId;
3131
3232{
3333 console . log ( "getJson async await" ) ;
34- const page1 = await getJson ( { engine : "google" , ... params } ) ;
34+ const page1 = await getJson ( Object . assign ( { engine : "google" } , params ) ) ;
3535 searchId = page1 [ "search_metadata" ] [ "id" ] ;
3636 if ( ! page1 [ "organic_results" ] ) throw new Error ( "No organic results" ) ;
3737 const page2 = await page1 . next ?. ( ) ;
@@ -40,7 +40,7 @@ let searchId;
4040
4141{
4242 console . log ( "getJson callback" ) ;
43- getJson ( { engine : "google" , ... params } , ( page1 ) => {
43+ getJson ( Object . assign ( { engine : "google" } , params ) , ( page1 ) => {
4444 if ( ! page1 [ "organic_results" ] ) throw new Error ( "No organic results" ) ;
4545 page1 . next ?. ( ( page2 ) => {
4646 if ( ! page2 [ "organic_results" ] ) throw new Error ( "No organic results" ) ;
@@ -112,10 +112,10 @@ let searchId;
112112
113113{
114114 console . log ( "getHtml" ) ;
115- const html = await getHtml ( { engine : "google" , ... params } ) ;
115+ const html = await getHtml ( Object . assign ( { engine : "google" } , params ) ) ;
116116 if ( html . length < 1000 ) throw new Error ( "Incorrect HTML" ) ;
117117
118- getHtml ( { engine : "google" , ... params } , ( html ) => {
118+ getHtml ( Object . assign ( { engine : "google" } , params ) , ( html ) => {
119119 if ( html . length < 1000 ) throw new Error ( "Incorrect HTML" ) ;
120120 } ) ;
121121}
0 commit comments