From fbd2c6853c8e6c69646295ba40dc4d6a3a0ee951 Mon Sep 17 00:00:00 2001 From: chenhui9279 Date: Mon, 25 Oct 2021 16:44:54 +0800 Subject: [PATCH] feat: require the use of `===` and `!==` --- src/ua-parser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index 1e88c0a27..ae6066d37 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -123,7 +123,7 @@ q = props[p]; // check if given property is actually array if (typeof q === OBJ_TYPE && q.length > 0) { - if (q.length == 2) { + if (q.length === 2) { if (typeof q[1] == FUNC_TYPE) { // assign modified match this[q[0]] = q[1].call(this, match); @@ -131,7 +131,7 @@ // assign given value, ignore regex match this[q[0]] = q[1]; } - } else if (q.length == 3) { + } else if (q.length === 3) { // check whether function or regex if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) { // call function (usually string mapper) @@ -140,7 +140,7 @@ // sanitize match using given regex this[q[0]] = match ? match.replace(q[1], q[2]) : undefined; } - } else if (q.length == 4) { + } else if (q.length === 4) { this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; } } else {