Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit faceae4

Browse filesBrowse files
Trottdanielleadams
authored andcommitted
crypto: revise variables for const use instead of let
This prepares the code for enabling the no-cond-assign rule. PR-URL: #41614 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent d5efecd commit faceae4
Copy full SHA for faceae4

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Open diff view settings
Collapse file

‎lib/internal/crypto/scrypt.js‎

Copy file name to clipboardExpand all lines: lib/internal/crypto/scrypt.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ function check(password, salt, keylen, options) {
9898

9999
let { N, r, p, maxmem } = defaults;
100100
if (options && options !== defaults) {
101-
let has_N, has_r, has_p;
102-
if (has_N = (options.N !== undefined)) {
101+
const has_N = options.N !== undefined;
102+
if (has_N) {
103103
N = options.N;
104104
validateUint32(N, 'N');
105105
}
@@ -108,7 +108,8 @@ function check(password, salt, keylen, options) {
108108
N = options.cost;
109109
validateUint32(N, 'cost');
110110
}
111-
if (has_r = (options.r !== undefined)) {
111+
const has_r = (options.r !== undefined);
112+
if (has_r) {
112113
r = options.r;
113114
validateUint32(r, 'r');
114115
}
@@ -117,7 +118,8 @@ function check(password, salt, keylen, options) {
117118
r = options.blockSize;
118119
validateUint32(r, 'blockSize');
119120
}
120-
if (has_p = (options.p !== undefined)) {
121+
const has_p = options.p !== undefined;
122+
if (has_p) {
121123
p = options.p;
122124
validateUint32(p, 'p');
123125
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.