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

bbox-fns

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bbox-fns - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

9

package.json
{
"name": "bbox-fns",
"version": "0.6.0",
"version": "0.7.0",
"description": "Light-weight JavaScript Bounding Box Utility Functions",

@@ -21,3 +21,3 @@ "main": "index.js",

"f": "npm run format",
"format": "npx prettier --arrow-parens=avoid --trailing-comma=none --write *.js",
"format": "npx prettier --arrow-parens=avoid --trailing-comma=none --write *.js */*.js",
"test": "node test.js"

@@ -39,3 +39,6 @@ },

},
"homepage": "https://github.com/DanielJDufour/bbox-fns#readme"
"homepage": "https://github.com/DanielJDufour/bbox-fns#readme",
"dependencies": {
"preciso": "^0.11.0"
}
}

@@ -18,2 +18,3 @@ # bbox-fns: work in progress

- [intersect](#intersect)
- [merge](#merge)
- [polygon](#polygon)

@@ -106,2 +107,13 @@ - [reproject](#reproject)

### merge
```js
import merge from "bbox-fns/merge.js";
const western_hemisphere = [-180, -90, 0, 90];
const eastern_hemisphere = [0, -90, 180, 90];
const bboxes = [western_hemisphere, eastern_hemisphere];
merge(bboxes);
[-180, -90, 180, 90] // bbox for the whole globe
```
### polygon

@@ -162,1 +174,14 @@ Create GeoJSON-Like Polygon from a Bounding Box

This library borrows the names of some similar [Turf.js](https://turfjs.org/) functions, but it does not borrow the internal code.
### advanced usage
#### precise functions
In order to avoid floating point arithmetic errors, you can use the precise version of these functions where numbers are represented as strings.
```js
import preciseDensePolygon from "bbox-fns/precise/dense-polygon.js";
preciseDensePolygon(bbox, { density: 100 }); // add 100 points to each side
preciseDensePolygon(bbox, { density: [359, 179] }); // add 359 points to top and bottom, and 179 points to the left and right
[
[ '-180', '80' ], [ '-180', '79' ], [ '-180', '78' ], [ '-180', '77' ], /* ... */, [ '-180', '80' ]
]
```
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