Socket
Socket
Sign inDemoInstall

default-gateway

Package Overview
Dependencies
1
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.1 to 6.0.2

4

darwin.js

@@ -6,3 +6,3 @@ "use strict";

const execa = require("execa");
const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"];
const dests = new Set(["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]);

@@ -26,3 +26,3 @@ const args = {

const iface = results[family === "v4" ? v4IfaceColumn : 3];
if (dests.includes(target) && gateway && isIP(gateway)) {
if (dests.has(target) && gateway && isIP(gateway)) {
result = {gateway, interface: (iface ? iface : null)};

@@ -29,0 +29,0 @@ return true;

@@ -5,3 +5,3 @@ "use strict";

const execa = require("execa");
const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"];
const dests = new Set(["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]);

@@ -18,3 +18,3 @@ const args = {

const [target, gateway, _, iface] = line.split(/ +/) || [];
if (dests.includes(target) && gateway && isIP(gateway)) {
if (dests.has(target) && gateway && isIP(gateway)) {
result = {gateway, interface: (iface ? iface : null)};

@@ -21,0 +21,0 @@ return true;

@@ -19,11 +19,8 @@ "use strict";

if (supportedPlatforms.has(plat)) {
let file;
let file = plat;
if (plat === "aix") {
// AIX `netstat` output is compatible with Solaris
file = `${type() === "OS400" ? "ibmi" : "sunos"}.js`;
} else {
file = `${plat}.js`;
file = type() === "OS400" ? "ibmi" : "sunos"; // AIX `netstat` output is compatible with Solaris
}
const m = require(`./${file}`);
const m = require(`./${file}.js`);
module.exports.v4 = () => m.v4();

@@ -37,4 +34,4 @@ module.exports.v6 = () => m.v6();

module.exports.v6 = () => Promise.reject(err);
module.exports.v4.sync = () => {throw err; };
module.exports.v6.sync = () => {throw err; };
module.exports.v4.sync = () => { throw err; };
module.exports.v6.sync = () => { throw err; };
}

@@ -5,3 +5,3 @@ "use strict";

const execa = require("execa");
const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"];
const dests = new Set(["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]);

@@ -21,3 +21,3 @@ const args = {

const iface = results[7];
if (dests.includes(target) && gateway && isIP(gateway)) {
if (dests.has(target) && gateway && isIP(gateway)) {
result = {gateway, interface: (iface ? iface : null)};

@@ -24,0 +24,0 @@ return true;

{
"name": "default-gateway",
"version": "6.0.1",
"version": "6.0.2",
"description": "Get the default network gateway, cross-platform.",
"author": "silverwind <me@silverwind.io>",
"author": "silverwind",
"repository": "silverwind/default-gateway",
"license": "BSD-2-Clause",
"main": "index.js",
"scripts": {
"test": "make test"
},
"engines": {

@@ -27,10 +24,10 @@ "node": ">= 10"

"dependencies": {
"execa": "^4.0.2"
"execa": "^4.0.3"
},
"devDependencies": {
"eslint": "7.1.0",
"eslint-config-silverwind": "13.4.2",
"jest": "26.0.1",
"updates": "10.2.12",
"versions": "8.2.10"
"eslint": "7.7.0",
"eslint-config-silverwind": "18.0.5",
"jest": "26.4.2",
"updates": "10.3.5",
"versions": "8.4.3"
},

@@ -37,0 +34,0 @@ "keywords": [

# default-gateway
[![](https://img.shields.io/npm/v/default-gateway.svg?style=flat)](https://www.npmjs.org/package/default-gateway) [![](https://img.shields.io/npm/dm/default-gateway.svg)](https://www.npmjs.org/package/default-gateway)
> Get the default network gateway, cross-platform.
Obtains the machine's default gateway through `exec` calls to OS routing interfaces.

@@ -16,3 +14,3 @@

```
$ npm install default-gateway
$ npm i default-gateway
```

@@ -19,0 +17,0 @@

@@ -5,3 +5,3 @@ "use strict";

const execa = require("execa");
const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"];
const dests = new Set(["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]);

@@ -21,3 +21,3 @@ const args = {

const iface = results[5];
if (dests.includes(target) && gateway && isIP(gateway)) {
if (dests.has(target) && gateway && isIP(gateway)) {
result = {gateway, interface: (iface ? iface : null)};

@@ -24,0 +24,0 @@ return true;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc