@fireproof/core 0.20.0-dev-preview-10 → 0.20.0-dev-preview-11

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ describe("basic Index", () => {
32
32
  });
33
33
  beforeEach(async function () {
34
34
  await sthis.start();
35
- db = fireproof.DB("test-indexer");
35
+ db = fireproof("test-indexer");
36
36
  await db.put({ title: "amazing" });
37
37
  await db.put({ title: "creative" });
38
38
  await db.put({ title: "bazillas" });
@@ -119,7 +119,7 @@ describe("Index query with compound key", function () {
119
119
  });
120
120
  beforeEach(async function () {
121
121
  await sthis.start();
122
- db = fireproof.DB("test-indexer");
122
+ db = fireproof("test-indexer");
123
123
  await db.put({ title: "amazing", score: 1 });
124
124
  await db.put({ title: "creative", score: 2 });
125
125
  await db.put({ title: "creative", score: 20 });
@@ -149,7 +149,7 @@ describe("basic Index with map fun", function () {
149
149
  });
150
150
  beforeEach(async function () {
151
151
  await sthis.start();
152
- db = fireproof.DB("test-indexer");
152
+ db = fireproof("test-indexer");
153
153
  await db.put({ title: "amazing" });
154
154
  await db.put({ title: "creative" });
155
155
  await db.put({ title: "bazillas" });
@@ -177,7 +177,7 @@ describe("basic Index with map fun with value", function () {
177
177
  });
178
178
  beforeEach(async function () {
179
179
  await sthis.start();
180
- db = fireproof.DB("test-indexer");
180
+ db = fireproof("test-indexer");
181
181
  await db.put({ title: "amazing" });
182
182
  await db.put({ title: "creative" });
183
183
  await db.put({ title: "bazillas" });
@@ -217,7 +217,7 @@ describe("Index query with map and compound key", function () {
217
217
  });
218
218
  beforeEach(async function () {
219
219
  await sthis.start();
220
- db = fireproof.DB("test-indexer");
220
+ db = fireproof("test-indexer");
221
221
  await db.put({ title: "amazing", score: 1 });
222
222
  await db.put({ title: "creative", score: 2 });
223
223
  await db.put({ title: "creative", score: 20 });
@@ -247,7 +247,7 @@ describe("basic Index with string fun", function () {
247
247
  });
248
248
  beforeEach(async function () {
249
249
  await sthis.start();
250
- db = fireproof.DB("test-indexer");
250
+ db = fireproof("test-indexer");
251
251
  await db.put({ title: "amazing" });
252
252
  await db.put({ title: "creative" });
253
253
  await db.put({ title: "bazillas" });
@@ -388,7 +388,7 @@ describe("basic Index with no data", function () {
388
388
  });
389
389
  beforeEach(async function () {
390
390
  await sthis.start();
391
- db = fireproof.DB("test-indexer");
391
+ db = fireproof("test-indexer");
392
392
  indexer = new Index<string, TestType>(sthis, db.ledger.crdt, "hello", (doc) => {
393
393
  didMap = true;
394
394
  return doc.title;
@@ -26,7 +26,7 @@ describe("Multiple Databases", () => {
26
26
  .fill(0)
27
27
  .map(async (_, i) => {
28
28
  const name = `db-${group}-${i}`;
29
- const db = fireproof.DB(name);
29
+ const db = fireproof(name);
30
30
  dbs.push({ db, name });
31
31
  for (let i = 0; i < rows; i++) {
32
32
  await db.put({ _id: `${name}-${i}`, hello: "world" });
@@ -33,7 +33,7 @@ describe("config file gateway", () => {
33
33
  });
34
34
 
35
35
  it("loader", async () => {
36
- const db = fireproof.DB(my_app());
36
+ const db = fireproof(my_app());
37
37
  await db.put({ name: "my-app" });
38
38
  expect(db.ledger.name).toBe(my_app());
39
39
 
@@ -110,7 +110,7 @@ describe("config file gateway", () => {
110
110
  /* */
111
111
  });
112
112
 
113
- const db = fireproof.DB(my_app(), { storeUrls: { base } });
113
+ const db = fireproof(my_app(), { storeUrls: { base } });
114
114
  // console.log(`>>>>>>>>>>>>>>>file-path`)
115
115
  await db.put({ name: "my-app" });
116
116
  expect(db.ledger.name).toBe(my_app());
@@ -177,7 +177,7 @@ describe("config file gateway", () => {
177
177
 
178
178
  expect(baseDir).toMatch(new RegExp(`/\\.fireproof/${rt.FILESTORE_VERSION.replace(/-file/, "")}/${my_app()}`));
179
179
 
180
- const db = fireproof.DB(my_app());
180
+ const db = fireproof(my_app());
181
181
  await db.put({ name: "my-app" });
182
182
  expect(db.ledger.name).toBe(my_app());
183
183
  const carStore = await db.ledger.crdt.blockstore.loader?.carStore();
@@ -250,7 +250,7 @@ describe("config file gateway", () => {
250
250
  /* */
251
251
  });
252
252
 
253
- const db = fireproof.DB(my_app());
253
+ const db = fireproof(my_app());
254
254
  await db.put({ name: "my-app" });
255
255
  expect(db.ledger.name).toBe(my_app());
256
256
  const carStore = await db.ledger.crdt.blockstore.loader.carStore();
@@ -12,7 +12,7 @@ describe("fireproof config indexdb", () => {
12
12
  });
13
13
 
14
14
  it("indexdb-loader", async () => {
15
- const db = fireproof.DB(my_app());
15
+ const db = fireproof(my_app());
16
16
  await db.put({ name: "my-app" });
17
17
  expect(db.ledger.name).toBe(my_app());
18
18