UNPKG

@nostr-dev-kit/ndk-mobile

Version:

NDK Mobile

26 lines (25 loc) 792 B
"use strict"; /** * Convenience method to search for profiles in the database. */ export function searchProfiles(adapter, query) { const pubkeys = adapter.db.getAllSync("SELECT * FROM profiles WHERE name LIKE ? OR about LIKE ? OR nip05 LIKE ? OR display_name LIKE ?", [`%${query}%`, `%${query}%`, `%${query}%`, `%${query}%`]); const results = []; for (const row of pubkeys) { const profile = { name: row.name, about: row.about, picture: row.picture, banner: row.banner, nip05: row.nip05, lud16: row.lud16, lud06: row.lud06, displayName: row.display_name, website: row.website, created_at: row.created_at }; results.push([row.pubkey, profile]); } return results; } //# sourceMappingURL=search-profiles.js.map