JS: Simplfy with set literal

This commit is contained in:
Asger F
2023-03-31 12:04:56 +02:00
parent 4a06b81429
commit 40530ae14d

View File

@@ -321,10 +321,7 @@ private module CryptoJS {
*/
private API::Node getAlgorithmNode(CryptographicAlgorithm algorithm) {
exists(string algorithmName | algorithm.matchesName(algorithmName) |
exists(API::Node mod | mod = API::moduleImport("crypto-js") |
result = mod.getMember(algorithmName) or
result = mod.getMember("Hmac" + algorithmName) // they prefix Hmac
)
result = API::moduleImport("crypto-js").getMember([algorithmName, "Hmac" + algorithmName])
or
result = API::moduleImport("crypto-js/" + algorithmName)
)