Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flatten-offset

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flatten-offset - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

15

index.js

@@ -16,7 +16,12 @@

class Offset {
static offsetPolygon(polygon, value) {
/**
* Offset polygon by given value
* @param {Polygon} polygon - input polygon
* @param {number} value - offset value, may be positive or negative
*/
static offset(polygon, value) {
let w = value;
let edges = [...polygon.edges];
let offsetPolygon = polygon;
let offsetPolygon = polygon.clone();
let offsetEdge;

@@ -206,6 +211,6 @@

Flatten.Polygon.prototype.offset = function(value) {
return Offset.offsetPolygon(this, value);
}
return Offset.offset(this, value);
};
module.exports = {}
module.exports = Offset;
{
"name": "flatten-offset",
"version": "1.0.0",
"version": "1.0.1",
"description": "Offset polygon",

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

@@ -28,2 +28,7 @@ [![npm version](https://badge.fury.io/js/flatten-offset.svg)](https://badge.fury.io/js/flatten-offset)

```
When using umd minified package:
```javascript
let {offset} = Offset;
let offsetPolygon = offset(polygon, offset_value)
```

@@ -34,3 +39,3 @@ Example:

require('flatten-offset');
let {segment, point, Polygon} = Flatten;
// Create polygon

@@ -37,0 +42,0 @@ let shapes = [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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