Skip to content

Commit

Permalink
Move extend datastore to utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
saul-jb committed Mar 31, 2024
1 parent 4c62236 commit 308ac62
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/daemon/src/common/entry-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Key, type Datastore } from 'interface-datastore'
import { sha256 } from 'multiformats/hashes/sha2'
import { compare as uint8ArrayCompare } from 'uint8arrays/compare'
import type { KeyvalueDB, Pair } from '@/interface.js'
import { extendDatastore } from '@/utils.js'
import { extendDatastore } from '@organicdesign/db-utils'

// Get the hash data from raw data.
const hashEntry = async (entry: unknown): Promise<Uint8Array> => {
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Sneakernet } from './sneakernet/index.js'
import { createTick } from './tick.js'
import type { KeyvalueDB } from '@/interface.js'
import { createLogger } from '@/logger.js'
import { extendDatastore } from '@/utils.js'
import { extendDatastore } from '@organicdesign/db-utils'

interface Setup {
socket: string
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/modules/filesystem/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import createUploadManager from './upload-operations.js'
import type { Context, Config } from './index.js'
import type { Components } from '@/common/interface.js'
import type { CID } from 'multiformats/cid'
import { extendDatastore } from '@/utils.js'
import { extendDatastore } from '@organicdesign/db-utils'

export default async (components: Components, config: Config): Promise<Context> => {
const { groups, datastore, blockstore, welo } = components
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/test/modules/base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CID } from 'multiformats/cid'
import { fromString as uint8ArrayFromString } from 'uint8arrays'
import { mkTestPath } from '../utils/paths.js'
import setup from '@/common/index.js'
import { extendDatastore } from '@/utils.js'
import { extendDatastore } from '@organicdesign/db-utils'

const parseStr = (data: string): Uint8Array => uint8ArrayFromString(data, 'base64')
const testPath = mkTestPath('base')
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import selectChunkerFunc from './select-chunker.js'

export { extendDatastore } from './extend-datastore.js'
export { exporter } from './exporter.js'
export { importer } from './importer.js'
export type * from './interface.js'
Expand Down

0 comments on commit 308ac62

Please sign in to comment.