Skip to content

Commit fbd2c68

Browse files
author
chenhui9279
committed
feat: require the use of === and !==
1 parent 29d5e43 commit fbd2c68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ua-parser.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@
123123
q = props[p];
124124
// check if given property is actually array
125125
if (typeof q === OBJ_TYPE && q.length > 0) {
126-
if (q.length == 2) {
126+
if (q.length === 2) {
127127
if (typeof q[1] == FUNC_TYPE) {
128128
// assign modified match
129129
this[q[0]] = q[1].call(this, match);
130130
} else {
131131
// assign given value, ignore regex match
132132
this[q[0]] = q[1];
133133
}
134-
} else if (q.length == 3) {
134+
} else if (q.length === 3) {
135135
// check whether function or regex
136136
if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
137137
// call function (usually string mapper)
@@ -140,7 +140,7 @@
140140
// sanitize match using given regex
141141
this[q[0]] = match ? match.replace(q[1], q[2]) : undefined;
142142
}
143-
} else if (q.length == 4) {
143+
} else if (q.length === 4) {
144144
this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;
145145
}
146146
} else {

0 commit comments

Comments
 (0)