
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
@xylabs/array
Advanced tools
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Using npm:
npm install {{name}}
Using yarn:
yarn add {{name}}
Using pnpm:
pnpm add {{name}}
Using bun:
bun add {{name}}
See the LICENSE file for license rights and limitations (LGPL-3.0-only).
### .temp-typedoc
### functions
### <a id="containsAll"></a>containsAll
function containsAll<T>(source, target): boolean;
Checks whether the source array contains every element in the target array.
T
T[]
The array to search within
T[]
The elements that must all be present
boolean
True if every target element exists in source
### <a id="distinct"></a>distinct
function distinct<T>(
value,
index,
array): boolean;
Array filter callback that removes duplicate values, with correct NaN handling.
Use with array.filter(distinct).
T
T
number
T[]
boolean
### <a id="filterAs"></a>filterAs
function filterAs<In, Out>(x, predicate): NonNullable<Out>[];
Maps each element using the predicate and filters out nullish results.
In
Out
In[]
The input array
(a) => Out
Transform function applied to each element
NonNullable<Out>[]
Array of non-nullish transformed values
### <a id="filterAsync"></a>filterAsync
function filterAsync<T>(array, predicate): Promise<T[]>;
Returns the elements of an array that meet the condition specified in a callback function.
T
T[]
The array to filter.
(value, index, array) => Promise<boolean>
A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
Promise<T[]>
The elements of an array that meet the condition specified in a callback function.
### <a id="findAs"></a>findAs
function findAs<In, Out>(x, predicate): NonNullable<Out> | undefined;
Maps each element using the predicate and returns the first non-nullish result.
In
Out
In[]
The input array
(a) => Out
Transform function applied to each element
NonNullable<Out> | undefined
The first non-nullish transformed value, or undefined
### <a id="findLastAs"></a>findLastAs
function findLastAs<In, Out>(x, predicate): NonNullable<Out> | undefined;
Maps each element using the predicate and returns the last non-nullish result.
In
Out
In[]
The input array
(a) => Out
Transform function applied to each element
NonNullable<Out> | undefined
The last non-nullish transformed value, or undefined
### <a id="flatten"></a>flatten
function flatten<T>(a?, b?): T[];
Concatenates two values or arrays into a single flat array, filtering out nullish entries.
T
T | ConcatArray<T>
First value or array
T | ConcatArray<T>
Second value or array
T[]
A flat array of non-nullish elements
### <a id="uniq"></a>uniq
function uniq<T>(arr): T[];
Returns a new array with duplicate values removed.
T
T[]
The input array
T[]
A deduplicated array
### <a id="uniqBy"></a>uniqBy
function uniqBy<T, I>(arr, iteratee): T[];
Returns a new array with duplicates removed, using a key function for comparison.
T
I
T[]
The input array
(item) => I
Function that returns the key to compare by
T[]
A deduplicated array keeping the first occurrence of each key
FAQs
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
The npm package @xylabs/array receives a total of 3,787 weekly downloads. As such, @xylabs/array popularity was classified as popular.
We found that @xylabs/array demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.