( query: QueryValue, key: string, values: string[] )
| 71 | } |
| 72 | |
| 73 | export function appendExcludeTagValuesCondition( |
| 74 | query: QueryValue, |
| 75 | key: string, |
| 76 | values: string[] |
| 77 | ): string { |
| 78 | let currentQuery = Array.isArray(query) |
| 79 | ? query.pop() |
| 80 | : typeof query === 'string' |
| 81 | ? query |
| 82 | : ''; |
| 83 | const filteredValuesCondition = `[${values |
| 84 | .map(value => { |
| 85 | if (typeof value === 'string' && /[\s"]/.test(value)) { |
| 86 | value = `"${escapeDoubleQuotes(value)}"`; |
| 87 | } |
| 88 | return value; |
| 89 | }) |
| 90 | .join(', ')}]`; |
| 91 | |
| 92 | if (currentQuery) { |
| 93 | currentQuery += ` !${key}:${filteredValuesCondition}`; |
| 94 | } else { |
| 95 | currentQuery = `!${key}:${filteredValuesCondition}`; |
| 96 | } |
| 97 | |
| 98 | return currentQuery; |
| 99 | } |
| 100 | |
| 101 | // This function has multiple signatures to help with typing in callers. |
| 102 | export function decodeScalar(value: QueryValue): string | undefined; |
no test coverage detected