feat: validate intentional post requests
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import type { Post, PostPage } from './types'
|
||||
|
||||
export function flattenPostPages(pages: PostPage[]): Post[] {
|
||||
const seen = new Set<string>()
|
||||
return pages.flatMap(({ tweets }) =>
|
||||
tweets.filter(({ id }) => {
|
||||
if (seen.has(id)) return false
|
||||
seen.add(id)
|
||||
return true
|
||||
}),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user