From bdc467a4f3c7b9fe8bc54468b6fc4d80b8f1c098 Mon Sep 17 00:00:00 2001 From: Thomas Watson Steen Date: Sat, 7 May 2016 13:37:11 +0200 Subject: [PATCH] standard: use camel case all the time --- lib/service.js | 16 ++++++++-------- test/service.js | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/service.js b/lib/service.js index 091d196..52a1606 100644 --- a/lib/service.js +++ b/lib/service.js @@ -31,7 +31,7 @@ function Service (opts) { } Service.prototype._records = function () { - var records = [rr_ptr(this), rr_srv(this), rr_txt(this)] + var records = [rrPtr(this), rrSrv(this), rrTxt(this)] var self = this var interfaces = os.networkInterfaces() @@ -39,9 +39,9 @@ Service.prototype._records = function () { interfaces[name].forEach(function (addr) { if (addr.internal) return if (addr.family === 'IPv4') { - records.push(rr_a(self, addr.address)) + records.push(rrA(self, addr.address)) } else { - records.push(rr_aaaa(self, addr.address)) + records.push(rrAaaa(self, addr.address)) } }) }) @@ -49,7 +49,7 @@ Service.prototype._records = function () { return records } -function rr_ptr (service) { +function rrPtr (service) { return { name: service.type + TLD, type: 'PTR', @@ -58,7 +58,7 @@ function rr_ptr (service) { } } -function rr_srv (service) { +function rrSrv (service) { return { name: service.fqdn, type: 'SRV', @@ -70,7 +70,7 @@ function rr_srv (service) { } } -function rr_txt (service) { +function rrTxt (service) { return { name: service.fqdn, type: 'TXT', @@ -79,7 +79,7 @@ function rr_txt (service) { } } -function rr_a (service, ip) { +function rrA (service, ip) { return { name: service.host, type: 'A', @@ -88,7 +88,7 @@ function rr_a (service, ip) { } } -function rr_aaaa (service, ip) { +function rrAaaa (service, ip) { return { name: service.host, type: 'AAAA', diff --git a/test/service.js b/test/service.js index ab81e41..9903153 100644 --- a/test/service.js +++ b/test/service.js @@ -5,17 +5,17 @@ var test = require('tape') var Service = require('../lib/service') var getAddressesRecords = function (host) { - var addresses_records = [] + var records = [] var itrs = os.networkInterfaces() for (var i in itrs) { var addrs = itrs[i] for (var j in addrs) { if (addrs[j].internal === false) { - addresses_records.push({ data: addrs[j].address, name: host, ttl: 120, type: addrs[j].family === 'IPv4' ? 'A' : 'AAAA' }) + records.push({ data: addrs[j].address, name: host, ttl: 120, type: addrs[j].family === 'IPv4' ? 'A' : 'AAAA' }) } } } - return addresses_records + return records } test('no name', function (t) {