UnENVerse 0.42.6
Local-first desktop secrets manager — TypeScript frontend
Loading...
Searching...
No Matches
filters.ts File Reference
import type;

Functions

function export getDescendantProjectIds (projectId:string)
 
function export buildProjectTree (projects:Project[])
 
function export parseSearch (q:string)
 
function export getFiltered ()
 
function export sorted (arr:VaultEntry[])
 

Variables

export type ProjectTreeNode = Project & { children: ProjectTreeNode[]; virtual: boolean }
 
const SEARCH_FILTER_KEYS = ['price', 'cat', 'env']
 Search prefixes that mean "filter by this field".
 
const words
 
 return { filters, text: words.join(' ') }
 

Function Documentation

◆ getDescendantProjectIds()

function export getDescendantProjectIds (   projectId:string)

◆ buildProjectTree()

function export buildProjectTree (   projects:Project[])

◆ parseSearch()

function export parseSearch (   q:string)

◆ getFiltered()

function export getFiltered ( )

◆ sorted()

function export sorted (   arr:VaultEntry[])

Variable Documentation

◆ ProjectTreeNode

export type ProjectTreeNode = Project & { children: ProjectTreeNode[]; virtual: boolean }

◆ SEARCH_FILTER_KEYS

const SEARCH_FILTER_KEYS = ['price', 'cat', 'env']

Search prefixes that mean "filter by this field".

Everything else containing a colon is ordinary text.

Without the whitelist, any token with a colon became a filter: searching postgres://user produced the filter postgres="//user", which no branch in getFiltered reads, and left the text query empty — so looking for a connection string silently returned the entire vault instead of the one entry, and looked like everything matched.

◆ words

const words
Initial value:
{
const filters: Record<string, string> = {}

◆ return

return { filters, text: words.join(' ') }