Fix lint · serpapi/serpapi-javascript@776d5be · GitHub
Skip to content

Commit 776d5be

Browse files
committed
Fix lint
1 parent b74eb37 commit 776d5be

8 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎examples/node/js_node_14_up/basic_example.js‎

Lines changed: 1 addition & 0 deletions

‎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

0 commit comments

Comments
 (0)