Skip to content

Commit

Permalink
update @mapeo/schema to use decodeBlockPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Aug 22, 2023
1 parent 1925230 commit c6259d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@fastify/type-provider-typebox": "^3.3.0",
"@hyperswarm/secret-stream": "^6.1.2",
"@mapeo/crypto": "^1.0.0-alpha.4",
"@mapeo/schema": "^3.0.0-next.6",
"@mapeo/schema": "^3.0.0-next.7",
"@mapeo/sqlite-indexer": "^1.0.0-alpha.5",
"@sinclair/typebox": "^0.29.6",
"b4a": "^1.6.3",
Expand Down
8 changes: 2 additions & 6 deletions src/mapeo-project.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
import { decode } from '@mapeo/schema'
import { decodeBlockPrefix } from '@mapeo/schema'
import { drizzle } from 'drizzle-orm/better-sqlite3'
import { migrate } from 'drizzle-orm/better-sqlite3/migrator'

Expand Down Expand Up @@ -108,11 +108,7 @@ export class MapeoProject {

for (const entry of entries) {
try {
// TODO: replace with optimized function (https://github.com/digidem/mapeo-schema/pull/130)
const { schemaName } = decode(entry.block, {
index: entry.index,
coreKey: entry.key,
})
const { schemaName } = decodeBlockPrefix(entry.block)

if (schemaName === 'project') {
projectSettingsEntries.push(entry)
Expand Down

0 comments on commit c6259d2

Please sign in to comment.