Skip to content

Commit

Permalink
repo: commit prev as nullable, but non-optional (#2173)
Browse files Browse the repository at this point in the history
* repo: commit prev as nullable, but non-optional

* changeset
  • Loading branch information
bnewbold authored Feb 15, 2024
1 parent 5f9ff1f commit fcf8e3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-chicken-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@atproto/repo': patch
---

repo commit object prev field is nullable, but no longer nullable
4 changes: 2 additions & 2 deletions packages/repo/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const unsignedCommit = z.object({
data: common.cid,
rev: z.string(),
// `prev` added for backwards compatibility with v2, no requirement of keeping around history
prev: common.cid.nullable().optional(),
prev: common.cid.nullable(),
})
export type UnsignedCommit = z.infer<typeof unsignedCommit> & { sig?: never }

Expand All @@ -25,7 +25,7 @@ const commit = z.object({
version: z.literal(3),
data: common.cid,
rev: z.string(),
prev: common.cid.nullable().optional(),
prev: common.cid.nullable(),
sig: common.bytes,
})
export type Commit = z.infer<typeof commit>
Expand Down

0 comments on commit fcf8e3f

Please sign in to comment.