expo-sqlite-mock 3.0.0 → 3.0.1

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": "expo-sqlite-mock",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/zfben/expo-sqlite-mock",
6
6
  "repository": {
@@ -16,7 +16,11 @@
16
16
  "jest": {
17
17
  "preset": "jest-expo",
18
18
  "testEnvironment": "node",
19
- "testRegex": "/*\\.test\\.tsx?$"
19
+ "testRegex": "/*\\.test\\.tsx?$",
20
+ "maxWorkers": 1,
21
+ "setupFilesAfterEnv": [
22
+ "<rootDir>/src/__tests__/setup.ts"
23
+ ]
20
24
  },
21
25
  "files": [
22
26
  "src/ExpoSQLiteNext.ts",
@@ -1,13 +1,17 @@
1
1
  import sqlite3 from 'better-sqlite3'
2
2
 
3
3
  import type {
4
+ SQLiteBindParams,
4
5
  SQLiteBindValue,
5
6
  SQLiteOpenOptions,
6
- SQLiteBindParams,
7
- SQLiteRunResult, } from 'expo-sqlite'
7
+ SQLiteRunResult,
8
+ } from 'expo-sqlite'
8
9
 
9
10
  type SQLiteBindBlobParams = Record<string, Uint8Array>
10
- type SQLiteBindPrimitiveParams = Record<string, Exclude<SQLiteBindValue, Uint8Array>>
11
+ type SQLiteBindPrimitiveParams = Record<
12
+ string,
13
+ Exclude<SQLiteBindValue, Uint8Array>
14
+ >
11
15
  type SQLiteColumnNames = string[]
12
16
  type SQLiteColumnValues = any[]
13
17
 
@@ -91,16 +95,14 @@ class NativeStatement {
91
95
 
92
96
  //#region Asynchronous API
93
97
 
94
- public runAsync = (
98
+ public runAsync = async (
95
99
  _database: NativeDatabase,
96
100
  bindParams: SQLiteBindPrimitiveParams,
97
101
  bindBlobParams: SQLiteBindBlobParams,
98
102
  shouldPassAsArray: boolean
99
103
  ): Promise<SQLiteRunResult & { firstRowValues: SQLiteColumnValues }> =>
100
- Promise.resolve(
101
- this._run(
102
- normalizeSQLite3Args(bindParams, bindBlobParams, shouldPassAsArray)
103
- )
104
+ this._run(
105
+ normalizeSQLite3Args(bindParams, bindBlobParams, shouldPassAsArray)
104
106
  )
105
107
  public stepAsync = (_database: NativeDatabase): Promise<any> => {
106
108
  if (this.iterator == null) {