mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
:electron: Fix regex filters on electron app (#2929)
* fix regex on desktop app * add release notes
This commit is contained in:
@@ -95,6 +95,10 @@ export async function asyncTransaction(
|
||||
}
|
||||
}
|
||||
|
||||
function regexp(regex: string, text: string | null) {
|
||||
return new RegExp(regex).test(text) ? 1 : 0;
|
||||
}
|
||||
|
||||
export function openDatabase(pathOrBuffer: string | Buffer) {
|
||||
const db = new SQL(pathOrBuffer);
|
||||
// Define Unicode-aware LOWER and UPPER implementation.
|
||||
@@ -107,6 +111,8 @@ export function openDatabase(pathOrBuffer: string | Buffer) {
|
||||
db.function('UNICODE_UPPER', { deterministic: true }, (arg: string | null) =>
|
||||
arg?.toUpperCase(),
|
||||
);
|
||||
// @ts-expect-error @types/better-sqlite3 does not support setting strict 3rd argument
|
||||
db.function('REGEXP', { deterministic: true }, regexp);
|
||||
return db;
|
||||
}
|
||||
|
||||
|
||||
6
upcoming-release-notes/2929.md
Normal file
6
upcoming-release-notes/2929.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [MikesGlitch]
|
||||
---
|
||||
|
||||
Fixes regex filtering on the desktop app
|
||||
Reference in New Issue
Block a user