@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
10 lines (9 loc) • 477 B
TypeScript
/**
* Computes the intersection of multiple arrays, returning an array of unique elements
* that are present in all the input arrays.
* @template T - The type of elements in the arrays.
* @param arrays - A variable number of arrays to compute the intersection of.
* @returns An array containing the unique elements found in all the input arrays.
* - If no arrays are provided, returns an empty array.
*/
export default function intersection<T>(...arrays: T[][]): T[];