kibana/packages/kbn-es-query
Lukas Olson 8ca815aaa3
[kql] Fix literal toKqlExpression to escape special characters and keywords (#162195)
## Summary

`toKqlExpression` support was added in
https://github.com/elastic/kibana/pull/161601. This PR Fixes a bug with
`toKqlExpression` that did not properly escape special characters and
keywords.

Without this fix, you could get into a problematic situation like the
following:

```ts
const node = fromKueryExpression('field: bar\\*');
const result = toKqlExpression(node); // 'field: bar*'
```

This was incorrect, since if we were then to call `fromKueryExpression`
on this value again, we would get a wildcard (`bar*`), not a string.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2023-07-20 17:15:45 -03:00
..
src [kql] Fix literal toKqlExpression to escape special characters and keywords (#162195) 2023-07-20 17:15:45 -03:00
BUILD.bazel Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
index.ts [KQL] Add support for toKqlExpression (#161601) 2023-07-14 13:44:50 -07:00
jest.config.js [Es query] Move to package (#103530) 2021-07-21 17:10:55 +02:00
kibana.jsonc Update codeowners to move AppServices packages to DataDiscovery (#149065) 2023-01-18 13:34:28 -07:00
package.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
README.md [Es query] Move to package (#103530) 2021-07-21 17:10:55 +02:00
tsconfig.json Fix eslint rule for restricting certain lodash imports (#151023) 2023-02-16 08:35:09 -07:00

@kbn/es-query

Shared common (client and server sie) utilities shared across packages and plugins.