Skip to content

Commit 0a2dfe8

Browse files
committed
Fix spread operator
1 parent 545da21 commit 0a2dfe8

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

smoke_tests/commonjs/commonjs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const run = async () => {
2828

2929
{
3030
console.log("getJson async await");
31-
const page1 = await getJson({ engine: "google", ...params });
31+
const page1 = await getJson(Object.assign({ engine: "google" }, params));
3232
searchId = page1["search_metadata"]["id"];
3333
if (!page1["organic_results"]) throw new Error("No organic results");
3434
if (page1.next) {
@@ -39,7 +39,7 @@ const run = async () => {
3939

4040
{
4141
console.log("getJson callback");
42-
getJson({ engine: "google", ...params }, (page1) => {
42+
getJson(Object.assign({ engine: "google" }, params), (page1) => {
4343
if (!page1["organic_results"]) throw new Error("No organic results");
4444
if (page1.next) {
4545
page1.next((page2) => {
@@ -121,10 +121,10 @@ const run = async () => {
121121

122122
{
123123
console.log("getHtml");
124-
const html = await getHtml({ engine: "google", ...params });
124+
const html = await getHtml(Object.assign({ engine: "google" }, params));
125125
if (html.length < 1000) throw new Error("Incorrect HTML");
126126

127-
getHtml({ engine: "google", ...params }, (html) => {
127+
getHtml(Object.assign({ engine: "google" }, params), (html) => {
128128
if (html.length < 1000) throw new Error("Incorrect HTML");
129129
});
130130
}

smoke_tests/esm/esm.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)