@travetto/model-sqlite 3.3.5 → 3.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-sqlite",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "description": "SQLite backing for the travetto model module, with real-time modeling support for SQL schemas.",
5
5
  "keywords": [
6
6
  "sql",
@@ -28,11 +28,11 @@
28
28
  "dependencies": {
29
29
  "@travetto/config": "^3.3.4",
30
30
  "@travetto/context": "^3.3.3",
31
- "@travetto/model": "^3.3.5",
32
- "@travetto/model-query": "^3.3.5",
33
- "@travetto/model-sql": "^3.3.5",
34
- "@types/better-sqlite3": "^7.6.4",
35
- "better-sqlite3": "^8.5.2"
31
+ "@travetto/model": "^3.3.7",
32
+ "@travetto/model-query": "^3.3.7",
33
+ "@travetto/model-sql": "^3.3.7",
34
+ "@types/better-sqlite3": "^7.6.5",
35
+ "better-sqlite3": "^8.6.0"
36
36
  },
37
37
  "travetto": {
38
38
  "displayName": "SQLite Model Service"
package/src/connection.ts CHANGED
@@ -46,7 +46,7 @@ export class SqliteConnection extends Connection<sqlite3.Database> {
46
46
  const db = new Db(file, this.#config.options);
47
47
  await db.pragma('foreign_keys = ON');
48
48
  await db.pragma('journal_mode = WAL');
49
- db.function('regexp', (a, b) => new RegExp(a).test(b) ? 1 : 0);
49
+ db.function('regexp', (a, b) => new RegExp(`${a}`).test(`${b}`) ? 1 : 0);
50
50
  return db;
51
51
  }
52
52
 
@@ -72,7 +72,8 @@ export class SqliteConnection extends Connection<sqlite3.Database> {
72
72
  try {
73
73
  const out = await conn.prepare(query)[query.trim().startsWith('SELECT') ? 'all' : 'run']();
74
74
  if (Array.isArray(out)) {
75
- const records: T[] = [...out].map(v => ({ ...v }));
75
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
76
+ const records: T[] = [...out as T[]].map(v => ({ ...v }));
76
77
  return { count: out.length, records };
77
78
  } else {
78
79
  return { count: out.changes, records: [] };