From 4f98f2ff208f355b7e242661cf9c4594a702dbec Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 8 Dec 2020 12:42:35 +0100 Subject: [PATCH] code cleanup --- .eslintrc | 13 +++++++++++++ lib/util.js | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..d912d46 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,13 @@ +{ + "env": { + "browser": false, + "commonjs": true, + "es2021": true, + "node": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 12 + }, + "rules": {} +} diff --git a/lib/util.js b/lib/util.js index a4743ee..205e574 100644 --- a/lib/util.js +++ b/lib/util.js @@ -757,7 +757,7 @@ function decodePiCpuinfo(lines) { const serial = getValue(lines, 'serial', ':', true); let result = {}; - if (oldRevisionCodes.hasOwnProperty(revisionCode)) { + if ({}.hasOwnProperty.call(oldRevisionCodes, revisionCode)) { // old revision codes result = { model, @@ -787,7 +787,7 @@ function decodePiCpuinfo(lines) { memory: 256 * Math.pow(2, memSizeCode), manufacturer, processor, - type: typeList.hasOwnProperty(typeCode) ? typeList[typeCode] : '', + type: {}.hasOwnProperty.call(typeList, typeCode) ? typeList[typeCode] : '', revision: '1.' + revision.substr(7, 1), } }