JS: Replace '.prefix'/'.suffix' with '.matches'.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-10-13 13:19:45 +01:00
parent d85d009a54
commit f3bb0a676e
4 changed files with 5 additions and 10 deletions

View File

@@ -104,7 +104,7 @@ class AsyncSentinelCall extends DataFlow::CallNode {
exists(DataFlow::FunctionNode node | node.getAstNode() = asyncCallee |
// manual models
exists(string memberName |
not "Sync" = memberName.suffix(memberName.length() - 4) and
not memberName.matches("%Sync") and
this = NodeJSLib::FS::moduleMember(memberName).getACall() and
node = this.getCallback([1 .. 2])
)