@livestore/wa-sqlite 0.4.0-dev.22 → 0.4.0-dev.24

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.
Files changed (62) hide show
  1. package/README.md +46 -36
  2. package/dist/README.md +13 -13
  3. package/dist/fts5/wa-sqlite.mjs +1 -1
  4. package/dist/fts5/wa-sqlite.node.mjs +1 -1
  5. package/dist/fts5/wa-sqlite.node.wasm +0 -0
  6. package/dist/fts5/wa-sqlite.wasm +0 -0
  7. package/dist/wa-sqlite-async.mjs +1 -1
  8. package/dist/wa-sqlite-async.wasm +0 -0
  9. package/dist/wa-sqlite-jspi.mjs +1 -1
  10. package/dist/wa-sqlite-jspi.wasm +0 -0
  11. package/dist/wa-sqlite.mjs +1 -1
  12. package/dist/wa-sqlite.node.mjs +1 -1
  13. package/dist/wa-sqlite.node.wasm +0 -0
  14. package/dist/wa-sqlite.wasm +0 -0
  15. package/package.json +40 -29
  16. package/src/FacadeVFS.js +252 -261
  17. package/src/VFS.js +84 -85
  18. package/src/WebLocksMixin.js +357 -351
  19. package/src/examples/AccessHandlePoolVFS.js +185 -194
  20. package/src/examples/IDBBatchAtomicVFS.js +429 -409
  21. package/src/examples/IDBMirrorVFS.js +402 -409
  22. package/src/examples/MemoryAsyncVFS.js +32 -37
  23. package/src/examples/MemoryVFS.js +71 -75
  24. package/src/examples/OPFSAdaptiveVFS.js +206 -206
  25. package/src/examples/OPFSAnyContextVFS.js +141 -140
  26. package/src/examples/OPFSCoopSyncVFS.js +297 -299
  27. package/src/examples/OPFSPermutedVFS.js +529 -540
  28. package/src/examples/README.md +27 -15
  29. package/src/examples/tag.js +27 -27
  30. package/src/sqlite-api.js +910 -941
  31. package/src/sqlite-constants.js +246 -232
  32. package/src/types/globals.d.ts +52 -52
  33. package/src/types/index.d.ts +586 -576
  34. package/test/AccessHandlePoolVFS.test.js +21 -21
  35. package/test/IDBBatchAtomicVFS.test.js +69 -69
  36. package/test/IDBMirrorVFS.test.js +21 -21
  37. package/test/MemoryAsyncVFS.test.js +21 -21
  38. package/test/MemoryVFS.test.js +21 -21
  39. package/test/OPFSAdaptiveVFS.test.js +21 -21
  40. package/test/OPFSAnyContextVFS.test.js +21 -21
  41. package/test/OPFSCoopSyncVFS.test.js +21 -21
  42. package/test/OPFSPermutedVFS.test.js +21 -21
  43. package/test/TestContext.js +44 -41
  44. package/test/WebLocksMixin.test.js +369 -360
  45. package/test/api.test.js +23 -23
  46. package/test/api_exec.js +72 -61
  47. package/test/api_misc.js +53 -54
  48. package/test/api_statements.js +271 -279
  49. package/test/callbacks.test.js +492 -478
  50. package/test/data/idbv5.json +1135 -1
  51. package/test/sql.test.js +30 -30
  52. package/test/sql_0001.js +49 -33
  53. package/test/sql_0002.js +55 -34
  54. package/test/sql_0003.js +85 -49
  55. package/test/sql_0004.js +76 -47
  56. package/test/sql_0005.js +60 -44
  57. package/test/test-worker.js +171 -163
  58. package/test/vfs_xAccess.js +1 -2
  59. package/test/vfs_xClose.js +50 -49
  60. package/test/vfs_xOpen.js +73 -72
  61. package/test/vfs_xRead.js +31 -31
  62. package/test/vfs_xWrite.js +30 -29
@@ -1,27 +1,27 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
1
+ import { TestContext } from './TestContext.js'
2
+ import { vfs_xAccess } from './vfs_xAccess.js'
3
+ import { vfs_xClose } from './vfs_xClose.js'
4
+ import { vfs_xOpen } from './vfs_xOpen.js'
5
+ import { vfs_xRead } from './vfs_xRead.js'
6
+ import { vfs_xWrite } from './vfs_xWrite.js'
7
7
 
8
- const CONFIG = 'AccessHandlePoolVFS';
9
- const BUILDS = ['default', 'asyncify', 'jspi'];
8
+ const CONFIG = 'AccessHandlePoolVFS'
9
+ const BUILDS = ['default', 'asyncify', 'jspi']
10
10
 
11
- const supportsJSPI = await TestContext.supportsJSPI();
11
+ const supportsJSPI = await TestContext.supportsJSPI()
12
12
 
13
- describe(CONFIG, function() {
13
+ describe(CONFIG, function () {
14
14
  for (const build of BUILDS) {
15
- if (build === 'jspi' && !supportsJSPI) return;
15
+ if (build === 'jspi' && !supportsJSPI) return
16
16
 
17
- describe(build, function() {
18
- const context = new TestContext({ build, config: CONFIG });
19
-
20
- vfs_xAccess(context);
21
- vfs_xOpen(context);
22
- vfs_xClose(context);
23
- vfs_xRead(context);
24
- vfs_xWrite(context);
25
- });
17
+ describe(build, function () {
18
+ const context = new TestContext({ build, config: CONFIG })
19
+
20
+ vfs_xAccess(context)
21
+ vfs_xOpen(context)
22
+ vfs_xClose(context)
23
+ vfs_xRead(context)
24
+ vfs_xWrite(context)
25
+ })
26
26
  }
27
- });
27
+ })
@@ -1,97 +1,97 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
7
-
8
- import SQLiteESMFactory from '../dist/wa-sqlite-async.mjs';
9
- import * as SQLite from '../src/sqlite-api.js';
10
- import { IDBBatchAtomicVFS } from "../src/examples/IDBBatchAtomicVFS.js";
11
-
12
- const CONFIG = 'IDBBatchAtomicVFS';
13
- const BUILDS = ['asyncify', 'jspi'];
1
+ import SQLiteESMFactory from '../dist/wa-sqlite-async.mjs'
2
+ import { IDBBatchAtomicVFS } from '../src/examples/IDBBatchAtomicVFS.js'
3
+ import * as SQLite from '../src/sqlite-api.js'
4
+ import { TestContext } from './TestContext.js'
5
+ import { vfs_xAccess } from './vfs_xAccess.js'
6
+ import { vfs_xClose } from './vfs_xClose.js'
7
+ import { vfs_xOpen } from './vfs_xOpen.js'
8
+ import { vfs_xRead } from './vfs_xRead.js'
9
+ import { vfs_xWrite } from './vfs_xWrite.js'
10
+
11
+ const CONFIG = 'IDBBatchAtomicVFS'
12
+ const BUILDS = ['asyncify', 'jspi']
13
+
14
+ const supportsJSPI = await TestContext.supportsJSPI()
15
+
16
+ describe(CONFIG, function () {
17
+ for (const build of BUILDS) {
18
+ if (build === 'jspi' && !supportsJSPI) return
14
19
 
15
- const supportsJSPI = await TestContext.supportsJSPI();
20
+ describe(build, function () {
21
+ const context = new TestContext({ build, config: CONFIG })
16
22
 
17
- describe(CONFIG, function() {
18
- for (const build of BUILDS) {
19
- if (build === 'jspi' && !supportsJSPI) return;
20
-
21
- describe(build, function() {
22
- const context = new TestContext({ build, config: CONFIG });
23
-
24
- vfs_xAccess(context);
25
- vfs_xOpen(context);
26
- vfs_xClose(context);
27
- vfs_xRead(context);
28
- vfs_xWrite(context);
29
- });
23
+ vfs_xAccess(context)
24
+ vfs_xOpen(context)
25
+ vfs_xClose(context)
26
+ vfs_xRead(context)
27
+ vfs_xWrite(context)
28
+ })
30
29
  }
31
30
 
32
- it('should upgrade v5', async function() {
33
- await idbX(indexedDB.deleteDatabase('test'));
31
+ it('should upgrade v5', async function () {
32
+ await idbX(indexedDB.deleteDatabase('test'))
34
33
 
35
34
  {
36
35
  // Load IndexedDB with v5 data.
37
36
  const db = await new Promise((resolve, reject) => {
38
- const request = indexedDB.open('test', 5);
37
+ const request = indexedDB.open('test', 5)
39
38
  request.onupgradeneeded = () => {
40
- const db = request.result;
39
+ const db = request.result
41
40
  db.createObjectStore('blocks', {
42
- keyPath: ['path', 'offset', 'version']
43
- }).createIndex('version', ['path', 'version']);
44
- };
45
- request.onsuccess = () => resolve(request.result);
46
- request.onerror = () => reject(request.error);
47
- });
48
-
49
- const data = await fetch(new URL('./data/idbv5.json', import.meta.url))
50
- .then(response => response.json());
51
- const blocks = db.transaction('blocks', 'readwrite').objectStore('blocks');
52
- await Promise.all(data.blocks.map(block => {
53
- block.data = new Uint8Array(block.data);
54
- return idbX(blocks.put(block));
55
- }));
56
- db.close();
41
+ keyPath: ['path', 'offset', 'version'],
42
+ }).createIndex('version', ['path', 'version'])
43
+ }
44
+ request.onsuccess = () => resolve(request.result)
45
+ request.onerror = () => reject(request.error)
46
+ })
47
+
48
+ const data = await fetch(new URL('./data/idbv5.json', import.meta.url)).then((response) => response.json())
49
+ const blocks = db.transaction('blocks', 'readwrite').objectStore('blocks')
50
+ await Promise.all(
51
+ data.blocks.map((block) => {
52
+ block.data = new Uint8Array(block.data)
53
+ return idbX(blocks.put(block))
54
+ }),
55
+ )
56
+ db.close()
57
57
  }
58
58
 
59
59
  // Initialize SQLite.
60
- const module = await SQLiteESMFactory();
61
- const sqlite3 = SQLite.Factory(module);
60
+ const module = await SQLiteESMFactory()
61
+ const sqlite3 = SQLite.Factory(module)
62
62
 
63
- const vfs = await IDBBatchAtomicVFS.create('test', module);
63
+ const vfs = await IDBBatchAtomicVFS.create('test', module)
64
64
  // @ts-ignore
65
- sqlite3.vfs_register(vfs, true);
65
+ sqlite3.vfs_register(vfs, true)
66
66
 
67
- const db = await sqlite3.open_v2('demo');
67
+ const db = await sqlite3.open_v2('demo')
68
68
 
69
- let integrity = '';
69
+ let integrity = ''
70
70
  await sqlite3.exec(db, 'PRAGMA integrity_check', (row, columns) => {
71
- integrity = /** @type {string} */(row[0]);
72
- });
73
- expect(integrity).toBe('ok');
71
+ integrity = /** @type {string} */ (row[0])
72
+ })
73
+ expect(integrity).toBe('ok')
74
74
 
75
- const rows = [];
75
+ const rows = []
76
76
  await sqlite3.exec(db, 'SELECT x FROM foo ORDER BY rowid LIMIT 3', (row, columns) => {
77
- rows.push(row[0]);
78
- });
79
- expect(rows).toEqual([1, 2, 3]);
77
+ rows.push(row[0])
78
+ })
79
+ expect(rows).toEqual([1, 2, 3])
80
80
 
81
- await sqlite3.close(db);
82
- await vfs.close();
81
+ await sqlite3.close(db)
82
+ await vfs.close()
83
83
 
84
- await idbX(indexedDB.deleteDatabase('test'));
85
- });
86
- });
84
+ await idbX(indexedDB.deleteDatabase('test'))
85
+ })
86
+ })
87
87
 
88
88
  /**
89
- * @param {IDBRequest} request
89
+ * @param {IDBRequest} request
90
90
  * @returns {Promise}
91
91
  */
92
92
  function idbX(request) {
93
93
  return new Promise((resolve, reject) => {
94
- request.onsuccess = () => resolve(request.result);
95
- request.onerror = () => reject(request.error);
96
- });
97
- }
94
+ request.onsuccess = () => resolve(request.result)
95
+ request.onerror = () => reject(request.error)
96
+ })
97
+ }
@@ -1,27 +1,27 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
1
+ import { TestContext } from './TestContext.js'
2
+ import { vfs_xAccess } from './vfs_xAccess.js'
3
+ import { vfs_xClose } from './vfs_xClose.js'
4
+ import { vfs_xOpen } from './vfs_xOpen.js'
5
+ import { vfs_xRead } from './vfs_xRead.js'
6
+ import { vfs_xWrite } from './vfs_xWrite.js'
7
7
 
8
- const CONFIG = 'IDBMirrorVFS';
9
- const BUILDS = ['asyncify', 'jspi'];
8
+ const CONFIG = 'IDBMirrorVFS'
9
+ const BUILDS = ['asyncify', 'jspi']
10
10
 
11
- const supportsJSPI = await TestContext.supportsJSPI();
11
+ const supportsJSPI = await TestContext.supportsJSPI()
12
12
 
13
- describe(CONFIG, function() {
13
+ describe(CONFIG, function () {
14
14
  for (const build of BUILDS) {
15
- if (build === 'jspi' && !supportsJSPI) return;
15
+ if (build === 'jspi' && !supportsJSPI) return
16
16
 
17
- describe(build, function() {
18
- const context = new TestContext({ build, config: CONFIG });
19
-
20
- vfs_xAccess(context);
21
- vfs_xOpen(context);
22
- vfs_xClose(context);
23
- vfs_xRead(context);
24
- vfs_xWrite(context);
25
- });
17
+ describe(build, function () {
18
+ const context = new TestContext({ build, config: CONFIG })
19
+
20
+ vfs_xAccess(context)
21
+ vfs_xOpen(context)
22
+ vfs_xClose(context)
23
+ vfs_xRead(context)
24
+ vfs_xWrite(context)
25
+ })
26
26
  }
27
- });
27
+ })
@@ -1,27 +1,27 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
1
+ import { TestContext } from './TestContext.js'
2
+ import { vfs_xAccess } from './vfs_xAccess.js'
3
+ import { vfs_xClose } from './vfs_xClose.js'
4
+ import { vfs_xOpen } from './vfs_xOpen.js'
5
+ import { vfs_xRead } from './vfs_xRead.js'
6
+ import { vfs_xWrite } from './vfs_xWrite.js'
7
7
 
8
- const CONFIG = 'MemoryAsyncVFS';
9
- const BUILDS = ['asyncify', 'jspi'];
8
+ const CONFIG = 'MemoryAsyncVFS'
9
+ const BUILDS = ['asyncify', 'jspi']
10
10
 
11
- const supportsJSPI = await TestContext.supportsJSPI();
11
+ const supportsJSPI = await TestContext.supportsJSPI()
12
12
 
13
- describe(CONFIG, function() {
13
+ describe(CONFIG, function () {
14
14
  for (const build of BUILDS) {
15
- if (build === 'jspi' && !supportsJSPI) return;
15
+ if (build === 'jspi' && !supportsJSPI) return
16
16
 
17
- describe(build, function() {
18
- const context = new TestContext({ build, config: CONFIG });
19
-
20
- vfs_xAccess(context);
21
- vfs_xOpen(context);
22
- vfs_xClose(context);
23
- vfs_xRead(context);
24
- vfs_xWrite(context);
25
- });
17
+ describe(build, function () {
18
+ const context = new TestContext({ build, config: CONFIG })
19
+
20
+ vfs_xAccess(context)
21
+ vfs_xOpen(context)
22
+ vfs_xClose(context)
23
+ vfs_xRead(context)
24
+ vfs_xWrite(context)
25
+ })
26
26
  }
27
- });
27
+ })
@@ -1,27 +1,27 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
1
+ import { TestContext } from './TestContext.js'
2
+ import { vfs_xAccess } from './vfs_xAccess.js'
3
+ import { vfs_xClose } from './vfs_xClose.js'
4
+ import { vfs_xOpen } from './vfs_xOpen.js'
5
+ import { vfs_xRead } from './vfs_xRead.js'
6
+ import { vfs_xWrite } from './vfs_xWrite.js'
7
7
 
8
- const CONFIG = 'MemoryVFS';
9
- const BUILDS = ['default', 'asyncify', 'jspi'];
8
+ const CONFIG = 'MemoryVFS'
9
+ const BUILDS = ['default', 'asyncify', 'jspi']
10
10
 
11
- const supportsJSPI = await TestContext.supportsJSPI();
11
+ const supportsJSPI = await TestContext.supportsJSPI()
12
12
 
13
- describe(CONFIG, function() {
13
+ describe(CONFIG, function () {
14
14
  for (const build of BUILDS) {
15
- if (build === 'jspi' && !supportsJSPI) return;
15
+ if (build === 'jspi' && !supportsJSPI) return
16
16
 
17
- describe(build, function() {
18
- const context = new TestContext({ build, config: CONFIG });
19
-
20
- vfs_xAccess(context);
21
- vfs_xOpen(context);
22
- vfs_xClose(context);
23
- vfs_xRead(context);
24
- vfs_xWrite(context);
25
- });
17
+ describe(build, function () {
18
+ const context = new TestContext({ build, config: CONFIG })
19
+
20
+ vfs_xAccess(context)
21
+ vfs_xOpen(context)
22
+ vfs_xClose(context)
23
+ vfs_xRead(context)
24
+ vfs_xWrite(context)
25
+ })
26
26
  }
27
- });
27
+ })
@@ -1,27 +1,27 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
1
+ import { TestContext } from './TestContext.js'
2
+ import { vfs_xAccess } from './vfs_xAccess.js'
3
+ import { vfs_xClose } from './vfs_xClose.js'
4
+ import { vfs_xOpen } from './vfs_xOpen.js'
5
+ import { vfs_xRead } from './vfs_xRead.js'
6
+ import { vfs_xWrite } from './vfs_xWrite.js'
7
7
 
8
- const CONFIG = 'OPFSAdaptiveVFS';
9
- const BUILDS = ['asyncify', 'jspi'];
8
+ const CONFIG = 'OPFSAdaptiveVFS'
9
+ const BUILDS = ['asyncify', 'jspi']
10
10
 
11
- const supportsJSPI = await TestContext.supportsJSPI();
11
+ const supportsJSPI = await TestContext.supportsJSPI()
12
12
 
13
- describe(CONFIG, function() {
13
+ describe(CONFIG, function () {
14
14
  for (const build of BUILDS) {
15
- if (build === 'jspi' && !supportsJSPI) return;
15
+ if (build === 'jspi' && !supportsJSPI) return
16
16
 
17
- describe(build, function() {
18
- const context = new TestContext({ build, config: CONFIG });
19
-
20
- vfs_xAccess(context);
21
- vfs_xOpen(context);
22
- vfs_xClose(context);
23
- vfs_xRead(context);
24
- vfs_xWrite(context);
25
- });
17
+ describe(build, function () {
18
+ const context = new TestContext({ build, config: CONFIG })
19
+
20
+ vfs_xAccess(context)
21
+ vfs_xOpen(context)
22
+ vfs_xClose(context)
23
+ vfs_xRead(context)
24
+ vfs_xWrite(context)
25
+ })
26
26
  }
27
- });
27
+ })
@@ -1,27 +1,27 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
1
+ import { TestContext } from './TestContext.js'
2
+ import { vfs_xAccess } from './vfs_xAccess.js'
3
+ import { vfs_xClose } from './vfs_xClose.js'
4
+ import { vfs_xOpen } from './vfs_xOpen.js'
5
+ import { vfs_xRead } from './vfs_xRead.js'
6
+ import { vfs_xWrite } from './vfs_xWrite.js'
7
7
 
8
- const CONFIG = 'OPFSAnyContextVFS';
9
- const BUILDS = ['asyncify', 'jspi'];
8
+ const CONFIG = 'OPFSAnyContextVFS'
9
+ const BUILDS = ['asyncify', 'jspi']
10
10
 
11
- const supportsJSPI = await TestContext.supportsJSPI();
11
+ const supportsJSPI = await TestContext.supportsJSPI()
12
12
 
13
- describe(CONFIG, function() {
13
+ describe(CONFIG, function () {
14
14
  for (const build of BUILDS) {
15
- if (build === 'jspi' && !supportsJSPI) return;
15
+ if (build === 'jspi' && !supportsJSPI) return
16
16
 
17
- describe(build, function() {
18
- const context = new TestContext({ build, config: CONFIG });
19
-
20
- vfs_xAccess(context);
21
- vfs_xOpen(context);
22
- vfs_xClose(context);
23
- vfs_xRead(context);
24
- vfs_xWrite(context);
25
- });
17
+ describe(build, function () {
18
+ const context = new TestContext({ build, config: CONFIG })
19
+
20
+ vfs_xAccess(context)
21
+ vfs_xOpen(context)
22
+ vfs_xClose(context)
23
+ vfs_xRead(context)
24
+ vfs_xWrite(context)
25
+ })
26
26
  }
27
- });
27
+ })
@@ -1,27 +1,27 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
1
+ import { TestContext } from './TestContext.js'
2
+ import { vfs_xAccess } from './vfs_xAccess.js'
3
+ import { vfs_xClose } from './vfs_xClose.js'
4
+ import { vfs_xOpen } from './vfs_xOpen.js'
5
+ import { vfs_xRead } from './vfs_xRead.js'
6
+ import { vfs_xWrite } from './vfs_xWrite.js'
7
7
 
8
- const CONFIG = 'OPFSCoopSyncVFS';
9
- const BUILDS = ['default', 'asyncify', 'jspi'];
8
+ const CONFIG = 'OPFSCoopSyncVFS'
9
+ const BUILDS = ['default', 'asyncify', 'jspi']
10
10
 
11
- const supportsJSPI = await TestContext.supportsJSPI();
11
+ const supportsJSPI = await TestContext.supportsJSPI()
12
12
 
13
- describe(CONFIG, function() {
13
+ describe(CONFIG, function () {
14
14
  for (const build of BUILDS) {
15
- if (build === 'jspi' && !supportsJSPI) return;
15
+ if (build === 'jspi' && !supportsJSPI) return
16
16
 
17
- describe(build, function() {
18
- const context = new TestContext({ build, config: CONFIG });
19
-
20
- vfs_xAccess(context);
21
- vfs_xOpen(context);
22
- vfs_xClose(context);
23
- vfs_xRead(context);
24
- vfs_xWrite(context);
25
- });
17
+ describe(build, function () {
18
+ const context = new TestContext({ build, config: CONFIG })
19
+
20
+ vfs_xAccess(context)
21
+ vfs_xOpen(context)
22
+ vfs_xClose(context)
23
+ vfs_xRead(context)
24
+ vfs_xWrite(context)
25
+ })
26
26
  }
27
- });
27
+ })
@@ -1,27 +1,27 @@
1
- import { TestContext } from "./TestContext.js";
2
- import { vfs_xOpen } from "./vfs_xOpen.js";
3
- import { vfs_xAccess } from "./vfs_xAccess.js";
4
- import { vfs_xClose } from "./vfs_xClose.js";
5
- import { vfs_xRead } from "./vfs_xRead.js";
6
- import { vfs_xWrite } from "./vfs_xWrite.js";
1
+ import { TestContext } from './TestContext.js'
2
+ import { vfs_xAccess } from './vfs_xAccess.js'
3
+ import { vfs_xClose } from './vfs_xClose.js'
4
+ import { vfs_xOpen } from './vfs_xOpen.js'
5
+ import { vfs_xRead } from './vfs_xRead.js'
6
+ import { vfs_xWrite } from './vfs_xWrite.js'
7
7
 
8
- const CONFIG = 'OPFSPermutedVFS';
9
- const BUILDS = ['asyncify', 'jspi'];
8
+ const CONFIG = 'OPFSPermutedVFS'
9
+ const BUILDS = ['asyncify', 'jspi']
10
10
 
11
- const supportsJSPI = await TestContext.supportsJSPI();
11
+ const supportsJSPI = await TestContext.supportsJSPI()
12
12
 
13
- describe(CONFIG, function() {
13
+ describe(CONFIG, function () {
14
14
  for (const build of BUILDS) {
15
- if (build === 'jspi' && !supportsJSPI) return;
15
+ if (build === 'jspi' && !supportsJSPI) return
16
16
 
17
- describe(build, function() {
18
- const context = new TestContext({ build, config: CONFIG });
19
-
20
- vfs_xAccess(context);
21
- vfs_xOpen(context);
22
- vfs_xClose(context);
23
- vfs_xRead(context);
24
- vfs_xWrite(context);
25
- });
17
+ describe(build, function () {
18
+ const context = new TestContext({ build, config: CONFIG })
19
+
20
+ vfs_xAccess(context)
21
+ vfs_xOpen(context)
22
+ vfs_xClose(context)
23
+ vfs_xRead(context)
24
+ vfs_xWrite(context)
25
+ })
26
26
  }
27
- });
27
+ })