
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@lbzg/arrays
Advanced tools
Array helper.
npm i @lbzg/arrays
Attach to prototype or import Arrays or arr.
fns: add, addUnique, remove, get, getAll, has, count, indices, list
import '@lbzg/arrays'
const x = []
x.arr().add({id: 1})
x.arr().add([{id: 2}, 3, 3])
x.arr().addUnique(1) # does not get added
x.arr().remove(1)
x.arr().getAll() # [{id: 2}, 3, 3]
selector can be a value, an array of values or a function
# get(selector?, key? = 'id')
x.arr().get() # {id: 2}
x.arr().get(1) # undefined
x.arr().get(2) # {id: 2}
x.arr().get(3) # 3
x.arr().get([1, 2, 3]) # {id:2}
x.arr().get(x => x === 3) # 3
x.arr().getAll() # [{id: 2}, 3, 3]
x.arr().getAll(1) # []
x.arr().getAll(2) # [{id: 2}]
x.arr().getAll(3) # [3, 3]
x.arr().getAll([1, 2, 3]) # [{id: 2}, 3, 3]
x.arr().getAll(x => x === 3) # [3, 3]
x.arr().has(2) # true # has(selector?, key?)
x.arr().count() # 4 # count(selector?, key?)
x.arr().indices(1) # [0, 1] # indices(selector, key?)
x.arr().list() # [2] # list(key?)
arr(input?)Takes optional input and returns Arrays instance.
Array.prototype.arr() takes no input.
Arraysconstructor(input?)
add(
input): array ~ mutates array
addUnique(input, key?): array ~ mutates array
remove(selector, amount?, key?): array ~ mutates array
get(
selector?, key?): value | undefined
getAll(selector?, key?): array
has(selector?, key?): boolean ~ every for value(s); some for function
count(selector?, key?): number
indices(selector, key?): array ~ of matched indexes
list(key?): array ~ object key values
input ~ value or value[]
selector ~ value or value[] or function
key ~ string | number | symbol (object identifier)
FAQs
Javascript arrays extension.
We found that @lbzg/arrays demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.