Skip to content

Commit 3eaec20

Browse files
committed
tweaks
1 parent 8b92404 commit 3eaec20

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
let ports, services;
44

55
// port -> service
6-
module.exports.getService = function getService(port, protocol = "tcp") {
6+
module.exports.getService = (port, protocol = "tcp") => {
77
if (typeof port !== "number") throw new Error("expected a 'number'");
88
if (!ports) ports = require("./ports.json");
9-
109
return ports[`${port}/${protocol}`] || null;
1110
};
1211

1312
// service -> port
14-
module.exports.getPort = function getPort(service, protocol = "tcp") {
13+
module.exports.getPort = (service, protocol = "tcp") => {
1514
if (typeof service !== "string") throw new Error("expected a 'string'");
1615
if (!services) services = require("./services.json");
1716

test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use strict";
22

3-
const getService = require(".").getService;
4-
const getPort = require(".").getPort;
3+
const {getService, getPort} = require(".");
54
const {test, expect} = global;
65

76
test("getService", () => {

0 commit comments

Comments
 (0)