question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad string generating by Expression

See original GitHub issue

Expected Behavior

Trying to escape some random input to break expression

exp = new Influx.Expression();
exp.tag('symbol').equals.value(`GAZP()\'`).toString() // **`"symbol" = 'GAZP()\\\''`**

And it should escape characters correctly

Actual Behavior

But it doesn’t escape them

exp = new Influx.Expression();
exp.tag('symbol').equals.value(`GAZP()\'`).toString() // **`"symbol" = 'GAZP()\\''`**

Steps/Code to Reproduce the Problem

const influx = require('influx')
const exp = new influx.Expression();
exp.tag('symbol').equals.value(`GAZP()\'`).toString()
// ...

Specifications

  • Version: 5.5.1
  • Platform: Darwin

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
connor4312commented, Jun 15, 2020

Not yet. Though I plan to use Influx again (for the first time in ages) for some home automation stuff, so I will probably be spending some time on this library again

0reactions
bencevanscommented, Jul 22, 2020

🎉 This issue has been resolved in version 5.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Bad String Error - Stack Overflow
I am getting a bad string error. I have tried adding another backslash before the slashes but that changes the equations drastically.
Read more >
EGRET: Evil Generation of Regular Expression Tests
EGRET (Evil Generation of Regular Expression Tests) generates a set of accepted and rejected strings for a regular expression.
Read more >
Generating Evil Test Strings for Regular Expressions
This paper describes EGRET, a tool for generating evil test strings for regular expressions. EGRET focuses on common mistakes made by developers when...
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >
Generating Evil Test Strings for Regular Expressions
Changes are only applied to one string that contains that element. Create Evil Strings. 8. Parser. Convert to NFA. Traverse. NFA.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found