better-lookup
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -6,3 +6,3 @@ "use strict"; | ||
const dns = require("dns"); | ||
const fs = require("fs-extra"); | ||
const fs = require("fs"); | ||
const net_1 = require("net"); | ||
@@ -13,2 +13,3 @@ const util_1 = require("util"); | ||
const timestamp_1 = require("@hyurl/utils/timestamp"); | ||
const readFile = util_1.promisify(fs.readFile); | ||
const resolve4 = util_1.promisify(dns.resolve4); | ||
@@ -34,3 +35,3 @@ const resolve6 = util_1.promisify(dns.resolve6); | ||
} | ||
return (yield fs.readFile(file, "utf8")).split(/\r\n|\n/) | ||
return (yield readFile(file, "utf8")).split(/\r\n|\n/) | ||
.map(line => line.trim()) | ||
@@ -255,3 +256,3 @@ .filter(line => !line.startsWith("#")) | ||
let tryAttach = (options) => { | ||
if (!("lookup" in options)) { | ||
if (!options["lookup"]) { | ||
options["lookup"] = function (hostname, options, cb) { | ||
@@ -258,0 +259,0 @@ var _a; |
{ | ||
"name": "better-lookup", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A better async DNS lookup function for Node.js that implements atomic cache operation.", | ||
@@ -9,2 +9,3 @@ "main": "dist/index.js", | ||
"prepublishOnly": "tsc", | ||
"pretest": "tsc", | ||
"test": "mocha --exit" | ||
@@ -32,12 +33,10 @@ }, | ||
"https-proxy-agent": "^5.0.0", | ||
"mocha": "^8.1.3" | ||
"mocha": "^7.2.0" | ||
}, | ||
"dependencies": { | ||
"@hyurl/utils": "^0.2.5", | ||
"@types/fs-extra": "^8.1.1", | ||
"fs-extra": "^8.1.0" | ||
"@hyurl/utils": "^0.2.5" | ||
}, | ||
"engines": { | ||
"node": ">=8.0" | ||
"node": ">=8.3" | ||
} | ||
} |
import * as dns from "dns"; | ||
import * as fs from "fs-extra"; | ||
import * as fs from "fs"; | ||
import { isIP, Socket } from "net"; | ||
@@ -19,2 +19,3 @@ import { Agent as HttpAgent } from "http"; | ||
const readFile = promisify(fs.readFile); | ||
const resolve4 = promisify(dns.resolve4); | ||
@@ -42,3 +43,3 @@ const resolve6 = promisify(dns.resolve6); | ||
return (await fs.readFile(file, "utf8")).split(/\r\n|\n/) | ||
return (await readFile(file, "utf8")).split(/\r\n|\n/) | ||
.map(line => line.trim()) | ||
@@ -333,3 +334,3 @@ .filter(line => !line.startsWith("#")) | ||
agent: T & { | ||
createConnection?: (options: any, callback: Function) => Socket | ||
createConnection?: (options: any, callback: Function) => Socket; | ||
}, | ||
@@ -339,3 +340,3 @@ family: 0 | 4 | 6 = 0 | ||
let tryAttach = (options: Record<string, any>) => { | ||
if (!("lookup" in options)) { | ||
if (!options["lookup"]) { | ||
options["lookup"] = function ( | ||
@@ -369,5 +370,5 @@ hostname: string, | ||
function isHttpsProxyAgent(agent: any): agent is { proxy: Record<string, any> } { | ||
function isHttpsProxyAgent(agent: any): agent is { proxy: Record<string, any>; } { | ||
return agent.constructor.name === "HttpsProxyAgent" | ||
&& typeof agent.proxy === "object"; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
37939
1
635
- Removed@types/fs-extra@^8.1.1
- Removedfs-extra@^8.1.0
- Removed@types/fs-extra@8.1.5(transitive)
- Removed@types/node@20.14.2(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedundici-types@5.26.5(transitive)
- Removeduniversalify@0.1.2(transitive)