Skip to content

Commit 40530ae

Browse files
committed
JS: Simplfy with set literal
1 parent 4a06b81 commit 40530ae

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

javascript/ql/lib/semmle/javascript/frameworks/CryptoLibraries.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,7 @@ private module CryptoJS {
321321
*/
322322
private API::Node getAlgorithmNode(CryptographicAlgorithm algorithm) {
323323
exists(string algorithmName | algorithm.matchesName(algorithmName) |
324-
exists(API::Node mod | mod = API::moduleImport("crypto-js") |
325-
result = mod.getMember(algorithmName) or
326-
result = mod.getMember("Hmac" + algorithmName) // they prefix Hmac
327-
)
324+
result = API::moduleImport("crypto-js").getMember([algorithmName, "Hmac" + algorithmName])
328325
or
329326
result = API::moduleImport("crypto-js/" + algorithmName)
330327
)

0 commit comments

Comments
 (0)