Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false


[**.js]
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
32 changes: 32 additions & 0 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm run lint
4 changes: 2 additions & 2 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Browser extends EventEmitter {
data.type.forEach(function (type) {

let serviceKey = type.toString();
if (!services.hasOwnProperty(serviceKey)) {
if (!Object.prototype.hasOwnProperty.call(services, serviceKey)) {
setNew('new service - %s', serviceKey);
services[serviceKey] = {
type,
Expand All @@ -101,7 +101,7 @@ class Browser extends EventEmitter {
}

let host;
if (addresses.hasOwnProperty(adr)) {
if (Object.prototype.hasOwnProperty.call(addresses, adr)) {
host = addresses[adr];
}
else {
Expand Down
2 changes: 1 addition & 1 deletion lib/decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var Record = dns.DNSRecord;

var decodeSection = module.exports.decodeSection =
function (packet, sectionName, obj) {
if (!packet.hasOwnProperty(sectionName)) {
if (!Object.prototype.hasOwnProperty.call(packet, sectionName)) {
debug('error in packet', packet);
throw new Error('Section missing from packet:' + sectionName);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/networking.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Networking.prototype.start = function () {
var ifaceFilter = this.options.networkInterface;
var index = 0;
for (var key in interfaces) {
if ((interfaces.hasOwnProperty(key)) &&
if ((Object.prototype.hasOwnProperty.call(interfaces,key)) &&
((typeof ifaceFilter === 'undefined') || (key === ifaceFilter))) {
for (var i = 0; i < interfaces[key].length; i++) {
var iface = interfaces[key][i];
Expand Down
Loading