
Research
/Security News
Laravel Lang Compromised with RCE Backdoor Across 700+ Versions
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.
@xylabs/array
Advanced tools
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 14,384 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
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.

Security News
Socket found a malicious postinstall hook across 700+ GitHub repos, including PHP packages on Packagist and Node.js project repositories.

Security News
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain