jmespath / jmespath/jmespath.js
Escape single quotes in a raw string literal
- Dominant language
- JavaScript
- Stars
- 847
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
I may escape a single quote symbol in a path using `\`
For instance:
```ts
jmespath.search(
[{ state: "W'A" }, { state: "N'Y" }, { state: "W'A" }, { state: "W'A" }],
`length([?state == 'W\\'A'])`,
)
// Result: 3
```
But I can escape only one single quote in a raw string literal.
For instance:
```ts
jmespath.search(
[{ state: "W'A'A" }, { state: "N'Y" }, { state: "W'A'A" }, { state: "W'A'A" }],
`length([?state == 'W\\'A\\'A'])`,
)
// Result: 0
```
Expected behaviour:
Ability to escape as many single quotes as you want in a string literal using `\` symbol.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.