We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d90f674 commit 7fef846Copy full SHA for 7fef846
lib/index.js
@@ -30,15 +30,12 @@ class IntegrityStream extends MiniPass {
30
31
// options used for calculating stream. can't be changed.
32
if (opts?.algorithms) {
33
- this.algorithms = Array.from(
34
- new Set(opts.algorithms.concat(this.algorithm ? [this.algorithm] : []))
35
- )
+ this.algorithms = [...opts.algorithms]
36
} else {
37
this.algorithms = [...DEFAULT_ALGORITHMS]
38
-
39
- if (this.algorithm !== null && this.algorithm !== DEFAULT_ALGORITHMS[0]) {
40
- this.algorithms.push(this.algorithm)
41
- }
+ }
+ if (this.algorithm !== null && !this.algorithms.includes(this.algorithm)) {
+ this.algorithms.push(this.algorithm)
42
}
43
44
this.hashes = this.algorithms.map(crypto.createHash)
0 commit comments