message: Allow any JSONable as value
diff: @@ -49,6 +49,17 @@ test('DB.create throws ValueError when value undefined', async (t) => {
  await t.throwsAsync(db.create('test', undefined as any), ValueError);
  });
  +test('DB.create accepts arbitrary JSONables', async (t) => {
  + const { db } = t.context;
  + await db.create('test_string', 'hey');
  + await db.create('test_number', 7);
  + await db.create('test_boolean', true);
  + await db.create('test_date', new Date());
  + await db.create('test_object', { a: [7] });
  + await db.create('test_object', [{ a: 7 }]);
  + t.pass();
  +});
  +
  test('DB.remove returns false when no key exists', async (t) => {
  const { db } = t.context;
  t.false(await db.remove('test'));
  @@ -63,7 +74,7 @@ test('DB.remove removes existing key from DB and returns true', async (t) => {
  test('DB.update creates a new document if key does not exist and returns it', async (t) => {
  const { db } = t.context;
  - const next = await db.update('test', (prev) => ({ ...prev, a: 1 }));
  + const next = await db.update<any, { a: number }>('test', (prev) => ({ ...prev, a: 1 }));
  const val = await db.get('test');
  t.deepEqual(val, { a: 1 });
  t.deepEqual(val, next);
  @@ -79,7 +90,7 @@ test('DB.update uses initializer if key does not exist', async (t) => {
  test('DB.update updates an existing document', async (t) => {
  const { db } = t.context;
  await db.create('test', { b: 2 });
  - await db.update('test', (prev) => ({ ...prev, a: 1 }));
  + await db.update<{ b: number }, { a: number; b: number }>('test', (prev = { b: 3 }) => ({ ...prev, a: 1 }));
  const val = await db.get('test');
  t.deepEqual(val, { a: 1, b: 2 });
  });
  