Skip to content

Commit

Permalink
chore: deps
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Oct 25, 2021
1 parent 8072ee9 commit 431757b
Show file tree
Hide file tree
Showing 4 changed files with 245 additions and 575 deletions.
9 changes: 7 additions & 2 deletions src/adapter/cachedb/cache.db.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Readable } from 'stream'
import { JsonSchemaObject, JsonSchemaRootObject, ObjectWithId } from '@naturalcycles/js-lib'
import {
JsonSchemaObject,
JsonSchemaRootObject,
ObjectWithId,
StringMap,
} from '@naturalcycles/js-lib'
import { Debug, IDebugger } from '@naturalcycles/nodejs-lib'
import { BaseCommonDB } from '../../base.common.db'
import { CommonDB } from '../../common.db'
Expand Down Expand Up @@ -68,7 +73,7 @@ export class CacheDB extends BaseCommonDB implements CommonDB {
ids: string[],
opt: CacheDBOptions<ROW> = {},
): Promise<ROW[]> {
const resultMap: Record<string, ROW> = {}
const resultMap: StringMap<ROW> = {}
const missingIds: string[] = []

if (!opt.skipCache && !this.cfg.skipCache) {
Expand Down
3 changes: 2 additions & 1 deletion src/adapter/inmemory/inMemory.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
_sortObjectDeep,
JsonSchemaRootObject,
ObjectWithId,
_stringMapValues,
} from '@naturalcycles/js-lib'
import {
bufferReviver,
Expand Down Expand Up @@ -118,7 +119,7 @@ export class InMemoryDB implements CommonDB {
): Promise<JsonSchemaRootObject<ROW>> {
const table = this.cfg.tablesPrefix + _table
return {
...generateJsonSchemaFromData(Object.values(this.data[table] || {})),
...generateJsonSchemaFromData(_stringMapValues(this.data[table] || {})),
$id: `${table}.schema.json`,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/commondao/common.dao.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mockTime, MOCK_TS_2018_06_21 } from '@naturalcycles/dev-lib/dist/testing'
import { ErrorMode, pTuple, _omit, _range, _sortBy } from '@naturalcycles/js-lib'
import { ErrorMode, _omit, _range, _sortBy, pTry } from '@naturalcycles/js-lib'
import {
AjvSchema,
AjvValidationError,
Expand Down Expand Up @@ -291,7 +291,7 @@ test('ajvSchema', async () => {
})

// This should fail
const [err] = await pTuple(
const [err] = await pTry(
dao.save({
id: 'id123', // provided, so we can snapshot-match
k1: 5 as any,
Expand Down
Loading

0 comments on commit 431757b

Please sign in to comment.