New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sparse-array

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparse-array - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

tests/test-find.js

10

index.js

@@ -88,4 +88,12 @@ 'use strict'

find (finder) {
let i = 0, found, last
while ((i < this.length) && !found) {
last = this.get(i)
found = finder(last)
i++
}
return found ? last : undefined
}
_internalPositionFor (index, noCreate) {

@@ -92,0 +100,0 @@ const bytePos = this._bytePosFor(index, noCreate)

2

package.json
{
"name": "sparse-array",
"version": "1.1.2",
"version": "1.2.0",
"description": "Sparse array implementation in JS with no dependencies",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -51,4 +51,11 @@ # sparse-array

Find:
```js
const firstEven = arr.find((elem) => (elem % 2) === 0)
```
## License
ISC
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc