MCPcopy Index your code
hub / github.com/getsentry/sentry / appendTagCondition

Function appendTagCondition

static/app/utils/queryString.tsx:43–71  ·  view source on GitHub ↗
(
  query: QueryValue,
  key: string,
  value: null | string
)

Source from the content-addressed store, hash-verified

41 * Handles spacing and quoting if necessary.
42 */
43export function appendTagCondition(
44 query: QueryValue,
45 key: string,
46 value: null | string
47): string {
48 let currentQuery = Array.isArray(query)
49 ? query.pop()
50 : typeof query === 'string'
51 ? query
52 : '';
53
54 if (
55 typeof value === 'string' &&
56 // TODO(JoshuaKGoldberg):
57 // Unnecessary escape character: \( regexp/no-useless-escape
58 // Unnecessary escape character: \) regexp/no-useless-escape
59 // eslint-disable-next-line regexp/no-useless-escape
60 new RegExp(TAG_VALUE_ESCAPE_PATTERN).test(value)
61 ) {
62 value = `"${escapeDoubleQuotes(value)}"`;
63 }
64 if (currentQuery) {
65 currentQuery += ` ${key}:${value}`;
66 } else {
67 currentQuery = `${key}:${value}`;
68 }
69
70 return currentQuery;
71}
72
73export function appendExcludeTagValuesCondition(
74 query: QueryValue,

Callers 2

generateQueryWithTagFunction · 0.85

Calls 3

escapeDoubleQuotesFunction · 0.90
popMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected