View Source Nex.Messages.Filter (Nex v0.1.0)
Nostr Message schema.
This module is used both to cast raw filter maps into an internal format, and also to match events against those filters.
Link to this section Summary
Functions
Casts the map of filter consitions into a structured map.
Returns true if any of the list of filters matches the given event.
Returns true if the filter matches the given event.
Returns true if the filter is valid (not empty!)
Link to this section Types
Link to this section Functions
Casts the map of filter consitions into a structured map.
Specfically Nex turns tag conditions (any filter beginning with "#") into a list of tuples for simpler query building and filtering.
@spec match_any?([t()], Nex.Messages.Event.t()) :: boolean()
Returns true if any of the list of filters matches the given event.
@spec match_event?(t(), Nex.Messages.Event.t()) :: boolean()
Returns true if the filter matches the given event.
Returns true if the filter is valid (not empty!)