Skip to content
Snippets Groups Projects
Unverified Commit 46ea8fbf authored by Michael Clark's avatar Michael Clark Committed by GitHub
Browse files

:electron: Fix regex filters on electron app (#2929)

* fix regex on desktop app

* add release notes
parent 6a21f8e3
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
---
category: Bugfix
authors: [MikesGlitch]
---
Fixes regex filtering on the desktop app
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment