mirror of
https://github.com/dergigi/boris.git
synced 2026-01-20 07:14:44 +01:00
- Move shared helpers into src/utils/helpers.ts - Add ContentWithResolvedProfiles component file to avoid hooks rule violation - Use strong IconDefinition type in icon map - Resolve linter warnings and errors
14 lines
416 B
TypeScript
14 lines
416 B
TypeScript
export const formatDate = (timestamp: number): string => {
|
|
return new Date(timestamp * 1000).toLocaleDateString()
|
|
}
|
|
|
|
// Extract pubkeys from nprofile strings in content
|
|
export const extractNprofilePubkeys = (content: string): string[] => {
|
|
const nprofileRegex = /nprofile1[a-z0-9]+/gi
|
|
const matches = content.match(nprofileRegex) || []
|
|
const unique = new Set<string>(matches)
|
|
return Array.from(unique)
|
|
}
|
|
|
|
|