(dirName)
| 3989 | const useLowerTrim = tok.kind === 'designer'; |
| 3990 | pushEqualityListCondition(cond, params, col, [tok.value], 'OR', inverted, useLowerTrim); |
| 3991 | return cond[0] || '1'; |
| 3992 | } |
| 3993 | if (tok.kind === 'tag') { |
| 3994 | const f = { tags: [tok.value], tagCombine: 'OR', tagInverted: !!filters.tagInverted }; |
| 3995 | const cond = []; |
| 3996 | pushTagListSQL(cond, params, f); |
| 3997 | return cond[0] || '1'; |
| 3998 | } |
| 3999 | if (tok.kind === 'fileType') { |
| 4000 | const ftVal = tok.value; |
| 4001 | if (!ftVal) return null; |
| 4002 | if (ftVal.toLowerCase() === 'zip') { |
| 4003 | params.push('%::%'); |
| 4004 | return '(filePath LIKE ?)'; |
| 4005 | } |
| 4006 | const exts = getExtensionsForFileTypeFilter(ftVal); |
| 4007 | if (!exts || exts.length === 0) { |
| 4008 | params.push(`%.${String(ftVal).toLowerCase()}`); |
| 4009 | return '(LOWER(fileName) LIKE ?)'; |
| 4010 | } |
| 4011 | if (exts.length === 1) { |
| 4012 | params.push(`%${exts[0]}`); |
| 4013 | return '(LOWER(fileName) LIKE ?)'; |
| 4014 | } |
| 4015 | const ph = exts.map(() => 'LOWER(fileName) LIKE ?').join(' OR '); |
| 4016 | params.push(...exts.map(ext => `%${ext}`)); |
| 4017 | return `(${ph})`; |
| 4018 | } |
| 4019 | if (tok.kind === 'printed') { |
| 4020 | if (tok.value === 'printed') return '(printed = 1)'; |
| 4021 | if (tok.value === 'not-printed') return '(printed = 0 OR printed IS NULL)'; |
no test coverage detected