This commit is contained in:
2026-01-05 14:44:55 +08:00
parent ae4fcacd9d
commit a948118eb9
3 changed files with 17 additions and 5 deletions

12
test/test-and.ts Normal file
View File

@@ -0,0 +1,12 @@
import { filter } from '../src/index.ts';
const data = [
{ path: 'good', key: 'searchInfo', value: 1 },
{ path: 'good', key: 'other', value: 2 },
{ path: 'bad', key: 'searchInfo', value: 3 },
];
// 测试使用 AND 和双引号
console.log('Testing: WHERE path = \'good\' AND key = "searchInfo"');
const result = filter(data, 'WHERE path = \'good\' AND key = "searchInfo"');
console.log('Result:', JSON.stringify(result, null, 2));