@signaldb/core
Version:
SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON in
13 lines (12 loc) • 561 B
TypeScript
import type Selector from '../types/Selector';
type BaseItem = Record<string, any>;
/**
* Tests whether a given item matches a specified selector.
* Uses the `mingo` library to evaluate the query.
* @template T - The type of the item being tested.
* @param item - The item to test against the selector.
* @param selector - The query selector used to match the item.
* @returns A boolean indicating whether the item matches the selector.
*/
export default function match<T extends BaseItem = BaseItem>(item: T, selector: Selector<T>): boolean;
export {};