File tree Expand file tree Collapse file tree
astro-atproto-loader/__examples__/03-grouped-reposts/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,11 +21,16 @@ import { defineAtProtoLiveCollection } from "@fujocoded/astro-atproto-loader";
2121// Set up validation for schemas via zod
2222const BlobRefSchema = z
2323 . object ( {
24- ref : z . unknown ( ) ,
24+ ref : z . union ( [ z . string ( ) , z . object ( { $link : z . string ( ) } ) ] ) . nullish ( ) ,
2525 mimeType : z . string ( ) ,
2626 } )
2727 . transform ( ( blob ) => ( {
28- cid : blob . ref == null ? undefined : String ( blob . ref ) ,
28+ cid :
29+ blob . ref == null
30+ ? undefined
31+ : typeof blob . ref === "string"
32+ ? blob . ref
33+ : blob . ref . $link ,
2934 mimeType : blob . mimeType ,
3035 } ) ) ;
3136
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ const titleCase = (input: string, options: TitleOptions): string => {
260260 // A leading ellipsis (`...and more`) signals a continuation, so the
261261 // first-word force-cap is suppressed and small-word rules apply normally.
262262 const leadingHasMultiDot = / \. { 2 , } / . test ( leadingText ) ;
263- const leadingHasHardCap = [ ... leadingText ] . some ( ( c ) => HARD_CAP . has ( c ) ) ;
263+ const leadingHasHardCap = Array . from ( HARD_CAP ) . some ( ( c ) => leadingText . includes ( c ) ) ;
264264
265265 const out : string [ ] = [ ] ;
266266 let cursor = 0 ;
You can’t perform that action at this time.
0 commit comments