File tree 8 files changed +9
-4
lines changed
8 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
import * as Dotenv from "dotenv" ;
10
+ import process from "process" ;
10
11
import { config , getJson } from "serpapi" ;
11
12
12
13
Dotenv . config ( ) ;
Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
import * as Dotenv from "dotenv" ;
10
+ import process from "process" ;
10
11
import { config , getJson } from "serpapi" ;
11
12
12
13
Dotenv . config ( ) ;
Original file line number Diff line number Diff line change 3
3
*/
4
4
5
5
const Dotenv = require ( "dotenv" ) ;
6
+ const process = require ( "process" ) ;
6
7
const { config, getJson } = require ( "serpapi" ) ;
7
8
8
9
Dotenv . config ( ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const Dotenv = require("dotenv");
6
6
const { config, getJson } = require ( "serpapi" ) ;
7
7
const url = require ( "url" ) ;
8
8
const qs = require ( "querystring" ) ;
9
+ const process = require ( "process" ) ;
9
10
10
11
Dotenv . config ( ) ;
11
12
config . api_key = process . env . API_KEY ;
Original file line number Diff line number Diff line change 3
3
*/
4
4
5
5
const Dotenv = require ( "dotenv" ) ;
6
+ const process = require ( "process" ) ;
6
7
const {
7
8
config,
8
9
getJson,
Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
import Dotenv from "dotenv" ;
10
+ import process from "process" ;
10
11
import {
11
12
config ,
12
13
getAccount ,
Original file line number Diff line number Diff line change
1
+ import process from "node:process" ;
2
+
1
3
export type Config = {
2
4
api_key : string | null ;
3
5
timeout : number ;
@@ -9,9 +11,7 @@ export type Config = {
9
11
function getEnvVar ( name : string ) : string | undefined {
10
12
if ( typeof Deno !== "undefined" ) {
11
13
return Deno . env . get ( name ) ;
12
- // @ts -ignore: Node.js process
13
14
} else if ( typeof process !== "undefined" ) {
14
- // @ts -ignore: Node.js process
15
15
return process . env [ name ] ;
16
16
}
17
17
return undefined ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { HttpsProxyAgent } from "npm:https-proxy-agent";
6
6
import { RequestTimeoutError } from "./errors.ts" ;
7
7
import { config } from "./config.ts" ;
8
8
import { Buffer } from "node:buffer" ;
9
+ import process from "node:process" ;
9
10
10
11
/**
11
12
* This `_internals` object is needed to support stubbing/spying of
@@ -31,9 +32,7 @@ export function getSource() {
31
32
if ( denoVersion ) {
32
33
return `deno@${ denoVersion } ,${ moduleSource } ` ;
33
34
}
34
- // @ts -ignore: scope of nodejs
35
35
} else if ( typeof process == "object" ) {
36
- // @ts -ignore: scope of nodejs
37
36
const nodeVersion = process . versions ?. node ;
38
37
if ( nodeVersion ) {
39
38
return `nodejs@${ nodeVersion } ,${ moduleSource } ` ;
You can’t perform that action at this time.
0 commit comments