Skip to content

Commit

Permalink
eslint: Don't use the "allow-null" option for the "eqeqeq" rule
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoltman committed Oct 23, 2017
1 parent a915cdd commit df1a4ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dot-location": [2, "property"],
"dot-notation": 2,
"eol-last": 2,
"eqeqeq": [2, "allow-null"],
"eqeqeq": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"key-spacing": 2,
"keyword-spacing": 2,
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class UIDGenerator {
baseEncoding = UIDGenerator.BASE58;
}

if (uidLength == null) {
if (bitSize == null) {
if (uidLength === undefined || uidLength === null) {
if (bitSize === undefined || bitSize === null) {
bitSize = 128;
} else if (!Number.isInteger(bitSize) || bitSize <= 0 || bitSize % 8 !== 0) {
throw new TypeError('bitSize must be a positive integer that is a multiple of 8');
Expand All @@ -29,7 +29,7 @@ class UIDGenerator {
uidLength = Math.ceil(bitSize / Math.log2(baseEncoding.length));
this._byteSize = bitSize / 8;
} else {
if (bitSize != null) {
if (bitSize !== undefined && bitSize !== null) {
throw new TypeError('uidLength may not be specified when bitSize is also specified');
}
if (!Number.isInteger(uidLength) || uidLength <= 0) {
Expand Down

0 comments on commit df1a4ef

Please sign in to comment.