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), } }