We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 187fa87 commit 682e290Copy full SHA for 682e290
control-flow/sequential-execution/triple-encryption.js
@@ -1,6 +1,14 @@
1
import bcrypt from 'bcrypt';
2
3
function encrypt (text, rounds) {
4
+ if (!text || typeof text !== "string") {
5
+ return Promise.reject(new Error("Invalid text argument"));
6
+ }
7
+
8
+ if (!rounds || typeof rounds !== "number") {
9
+ return Promise.reject(new Error("Invalid rounds argument"));
10
11
12
return bcrypt.hash(text, rounds);
13
}
14
0 commit comments