prismic-client
prismic-client copied to clipboard
fix: support special characters in filters
Types of changes
- [ ] Chore (a non-breaking change which is related to package maintenance)
- [x] Bug fix (a non-breaking change which fixes an issue)
- [ ] New feature (a non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
This PR fixes a bug where special charcters, such as ", were not escaped in filters.
Before this PR (note the double ""):
import { filter } from "@prismicio/client";
filter.fulltext("my.page.key_text_field", '"quote"');
// => [fulltext(my.page.key_text_field, ""quote"")]
After this PR (note the escaped "):
import { filter } from "@prismicio/client";
filter.fulltext("my.page.key_text_field", '"quote"');
// => [fulltext(my.page.key_text_field, "\"quote\"")]
Fixes #314
Checklist:
- [ ] My change requires an update to the official documentation.
- [x] All TSDoc comments are up-to-date and new ones have been added where necessary.
- [x] All new and existing tests are passing.
🦡
Codecov Report
Merging #315 (718a2f1) into master (76fa2ca) will not change coverage. The diff coverage is
100.00%.
:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
@@ Coverage Diff @@
## master #315 +/- ##
=======================================
Coverage 99.96% 99.96%
=======================================
Files 50 50
Lines 6045 6045
Branches 294 294
=======================================
Hits 6043 6043
Misses 2 2
| Files Changed | Coverage Δ | |
|---|---|---|
| src/filter.ts | 100.00% <100.00%> (ø) |
Hi all, is thins going to be merged soon? thanks! :)
Can we merge that @angeloashmore?
Hi all, is thins going to be merged soon? thanks! :)