createGenerals

Filters text records to return only general profile fields (avatar, banner, header, display, description, url, location).


Usage

import { createGenerals } from '@justaname.id/sdk'

// Basic usage
const generalTexts = createGenerals([
  { key: 'description', value: 'My personal description' },
  { key: 'url', value: 'https://example.com' },
  { key: 'email', value: '[email protected]' },
  { key: 'avatar', value: 'https://example.com/avatar.jpg' },
  { key: 'com.twitter', value: '@username' }
])

console.log(generalTexts)
// [
//   { key: 'description', value: 'My personal description' },
//   { key: 'url', value: 'https://example.com' },
//   { key: 'email', value: '[email protected]' },
//   { key: 'avatar', value: 'https://example.com/avatar.jpg' }
// ]

Returns

Text[] - An array of text records with keys: avatar, banner, header, display, description, url, location

Parameters

  • texts: Text[] - Array of text records to filter

Defined in

packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts:74

Last updated

Was this helpful?