Skip to content

Commit 1785e46

Browse files
committed
don't modify passed hashes array
1 parent 61fa856 commit 1785e46

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ exports.sign = function (options, callback) {
88
var hashes = signOptions.hash
99
if (!hashes) {
1010
hashes = ['sha1', 'sha256']
11-
}
12-
if (!Array.isArray(hashes)) {
13-
hashes = [hashes]
11+
} else {
12+
hashes = Array.isArray(hashes) ? hashes.slice() : [hashes]
1413
}
1514

1615
var finalPath = getOutputPath(signOptions.path)

0 commit comments

Comments
 (0)