File tree Expand file tree Collapse file tree 8 files changed +9
-4
lines changed Expand file tree Collapse file tree 8 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 77 */
88
99import * as Dotenv from "dotenv" ;
10+ import process from "process" ;
1011import { config , getJson } from "serpapi" ;
1112
1213Dotenv . config ( ) ;
Original file line number Diff line number Diff line change 77 */
88
99import * as Dotenv from "dotenv" ;
10+ import process from "process" ;
1011import { config , getJson } from "serpapi" ;
1112
1213Dotenv . config ( ) ;
Original file line number Diff line number Diff line change 33 */
44
55const Dotenv = require ( "dotenv" ) ;
6+ const process = require ( "process" ) ;
67const { config, getJson } = require ( "serpapi" ) ;
78
89Dotenv . config ( ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const Dotenv = require("dotenv");
66const { config, getJson } = require ( "serpapi" ) ;
77const url = require ( "url" ) ;
88const qs = require ( "querystring" ) ;
9+ const process = require ( "process" ) ;
910
1011Dotenv . config ( ) ;
1112config . api_key = process . env . API_KEY ;
Original file line number Diff line number Diff line change 33 */
44
55const Dotenv = require ( "dotenv" ) ;
6+ const process = require ( "process" ) ;
67const {
78 config,
89 getJson,
Original file line number Diff line number Diff line change 77 */
88
99import Dotenv from "dotenv" ;
10+ import process from "process" ;
1011import {
1112 config ,
1213 getAccount ,
Original file line number Diff line number Diff line change 1+ import process from "node:process" ;
2+
13export type Config = {
24 api_key : string | null ;
35 timeout : number ;
@@ -9,9 +11,7 @@ export type Config = {
911function 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 ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { HttpsProxyAgent } from "npm:https-proxy-agent";
66import { RequestTimeoutError } from "./errors.ts" ;
77import { config } from "./config.ts" ;
88import { 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 } ` ;
You can’t perform that action at this time.
0 commit comments