add support for the flatted library

This commit is contained in:
Erik Krogh Kristensen
2021-06-24 11:09:09 +02:00
parent 1792c9a611
commit 9261b7f859
5 changed files with 8 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ private class PlainJsonParserCall extends JsonParserCall {
PlainJsonParserCall() {
exists(DataFlow::SourceNode callee | this = callee.getACall() |
callee = DataFlow::globalVarRef("JSON").getAPropertyRead("parse") or
callee = DataFlow::moduleMember(["json3", "json5"], "parse") or
callee = DataFlow::moduleMember(["json3", "json5", "flatted"], "parse") or
callee = DataFlow::moduleImport("parse-json") or
callee = DataFlow::moduleImport("json-parse-better-errors") or
callee = DataFlow::moduleImport("json-safe-parse") or

View File

@@ -11,7 +11,7 @@ class JsonStringifyCall extends DataFlow::CallNode {
JsonStringifyCall() {
exists(DataFlow::SourceNode callee | this = callee.getACall() |
callee = DataFlow::globalVarRef("JSON").getAPropertyRead("stringify") or
callee = DataFlow::moduleMember(["json3", "json5"], "stringify") or
callee = DataFlow::moduleMember(["json3", "json5", "flatted"], "stringify") or
callee =
DataFlow::moduleImport([
"json-stringify-safe", "json-stable-stringify", "stringify-object",