Skip to content

Commit 776d5be

Browse files
committed
Fix lint
1 parent b74eb37 commit 776d5be

File tree

8 files changed

+9
-4
lines changed

8 files changed

+9
-4
lines changed

examples/node/js_node_14_up/basic_example.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
import * as Dotenv from "dotenv";
10+
import process from "process";
1011
import { config, getJson } from "serpapi";
1112

1213
Dotenv.config();

examples/node/js_node_14_up/pagination_example.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
import * as Dotenv from "dotenv";
10+
import process from "process";
1011
import { config, getJson } from "serpapi";
1112

1213
Dotenv.config();

examples/node/js_node_7_up/basic_example.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
const Dotenv = require("dotenv");
6+
const process = require("process");
67
const { config, getJson } = require("serpapi");
78

89
Dotenv.config();

examples/node/js_node_7_up/pagination_example.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const Dotenv = require("dotenv");
66
const { config, getJson } = require("serpapi");
77
const url = require("url");
88
const qs = require("querystring");
9+
const process = require("process");
910

1011
Dotenv.config();
1112
config.api_key = process.env.API_KEY;

smoke_tests/commonjs/commonjs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
const Dotenv = require("dotenv");
6+
const process = require("process");
67
const {
78
config,
89
getJson,

smoke_tests/esm/esm.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
import Dotenv from "dotenv";
10+
import process from "process";
1011
import {
1112
config,
1213
getAccount,

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import process from "node:process";
2+
13
export type Config = {
24
api_key: string | null;
35
timeout: number;
@@ -9,9 +11,7 @@ export type Config = {
911
function getEnvVar(name: string): string | undefined {
1012
if (typeof Deno !== "undefined") {
1113
return Deno.env.get(name);
12-
// @ts-ignore: Node.js process
1314
} else if (typeof process !== "undefined") {
14-
// @ts-ignore: Node.js process
1515
return process.env[name];
1616
}
1717
return undefined;

src/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { HttpsProxyAgent } from "npm:https-proxy-agent";
66
import { RequestTimeoutError } from "./errors.ts";
77
import { config } from "./config.ts";
88
import { Buffer } from "node:buffer";
9+
import process from "node:process";
910

1011
/**
1112
* This `_internals` object is needed to support stubbing/spying of
@@ -31,9 +32,7 @@ export function getSource() {
3132
if (denoVersion) {
3233
return `deno@${denoVersion},${moduleSource}`;
3334
}
34-
// @ts-ignore: scope of nodejs
3535
} else if (typeof process == "object") {
36-
// @ts-ignore: scope of nodejs
3736
const nodeVersion = process.versions?.node;
3837
if (nodeVersion) {
3938
return `nodejs@${nodeVersion},${moduleSource}`;

0 commit comments

Comments
 (0)