Ignore escaped double quotes within strings
This commit is contained in:
parent
f7c816bce9
commit
334d9a956d
|
@ -123,7 +123,7 @@ module MongoDBModule {
|
|||
let i = 0
|
||||
let startIndex = 0
|
||||
for (let c of params) {
|
||||
if (c === '"') {
|
||||
if (c === '"' && (i > 0 && params[i-1] !== '\\')) {
|
||||
inQuotes = !inQuotes
|
||||
}
|
||||
if (c === "{" && !inQuotes) {
|
||||
|
|
|
@ -289,7 +289,7 @@ describe("MongoDB Integration", () => {
|
|||
},
|
||||
{
|
||||
"upsert": true,
|
||||
"extra": "ad{d"
|
||||
"extra": "ad\\"{\\"d"
|
||||
}`,
|
||||
extra: { collection: "testCollection", actionTypes: "updateOne" },
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ describe("MongoDB Integration", () => {
|
|||
})
|
||||
expect(args[2]).toEqual({
|
||||
upsert: true,
|
||||
extra: "ad{d"
|
||||
extra: "ad\"{\"d"
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue