mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	add isPureRenotePacked
This commit is contained in:
		
							parent
							
								
									41536480ce
								
							
						
					
					
						commit
						2fb2e52312
					
				
					 1 changed files with 12 additions and 0 deletions
				
			
		| 
						 | 
					@ -69,6 +69,14 @@ type PackedQuote =
 | 
				
			||||||
		fileIds: NonNullable<Packed<'Note'>['fileIds']>
 | 
							fileIds: NonNullable<Packed<'Note'>['fileIds']>
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type PurePackedRenote = PackedRenote & {
 | 
				
			||||||
 | 
						text: NonNullable<Packed<'Note'>['text']>;
 | 
				
			||||||
 | 
						cw: NonNullable<Packed<'Note'>['cw']>;
 | 
				
			||||||
 | 
						replyId: NonNullable<Packed<'Note'>['replyId']>;
 | 
				
			||||||
 | 
						poll: NonNullable<Packed<'Note'>['poll']>;
 | 
				
			||||||
 | 
						fileIds: NonNullable<Packed<'Note'>['fileIds']>;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function isRenotePacked(note: Packed<'Note'>): note is PackedRenote {
 | 
					export function isRenotePacked(note: Packed<'Note'>): note is PackedRenote {
 | 
				
			||||||
	return note.renoteId != null;
 | 
						return note.renoteId != null;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -80,3 +88,7 @@ export function isQuotePacked(note: PackedRenote): note is PackedQuote {
 | 
				
			||||||
		note.poll != null ||
 | 
							note.poll != null ||
 | 
				
			||||||
		(note.fileIds != null && note.fileIds.length > 0);
 | 
							(note.fileIds != null && note.fileIds.length > 0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function isPureRenotePacked(note: Packed<'Note'>): note is PurePackedRenote {
 | 
				
			||||||
 | 
						return isRenotePacked(note) && !isQuotePacked(note);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue