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

@lunit/is-complex-polygon

Package Overview
Dependencies
Maintainers
7
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lunit/is-complex-polygon - npm Package Compare versions

Comparing version 1.0.4 to 5.0.0-alpha.1

index.js.map

151

index.js

@@ -1,104 +0,5 @@

(function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = require("@lunit/is-intersection");
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isComplexPolygon", function() { return isComplexPolygon; });
/* harmony import */ var _lunit_is_intersection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _lunit_is_intersection__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lunit_is_intersection__WEBPACK_IMPORTED_MODULE_0__);
Object.defineProperty(exports, "__esModule", { value: true });
exports.isComplexPolygon = void 0;
const is_intersection_1 = require("@lunit/is-intersection");
/**

@@ -109,28 +10,24 @@ * polygon이 교차점을 가진 complex polygon인지 확인

function isComplexPolygon(polygon) {
// 끝점으로 최초점을 추가해서 닫힌 polygon을 만들어준다
const closedPolygon = [...polygon, polygon[0]];
const max = closedPolygon.length; // 0 ->
let i = -1;
while (++i < max - 2) {
// i + 1 ->
// 현재 i 지점의 이전은 검색할 필요가 없기 때문에 i 이후 지점부터 검색한다
let n = i + 2;
while (++n < max - 1) {
// line a -> b 와 line c -> d 가 교차하는지 체크한다
// i 가 point a 가 되고, i + 1 이 point b 가 된다
// i + 2 가 c, i + 3 이 d가 된다
// i + 1 -> i + 2 은 i -> i + 1 과 맞닿아있어 교차될 수 없으므로 제외한다
if (Object(_lunit_is_intersection__WEBPACK_IMPORTED_MODULE_0__["isIntersection"])(closedPolygon[i], closedPolygon[i + 1], closedPolygon[n], closedPolygon[n + 1])) {
return true;
}
// 끝점으로 최초점을 추가해서 닫힌 polygon을 만들어준다
const closedPolygon = [...polygon, polygon[0]];
const max = closedPolygon.length;
// 0 ->
let i = -1;
while (++i < max - 2) {
// i + 1 ->
// 현재 i 지점의 이전은 검색할 필요가 없기 때문에 i 이후 지점부터 검색한다
let n = i + 2;
while (++n < max - 1) {
// line a -> b 와 line c -> d 가 교차하는지 체크한다
// i 가 point a 가 되고, i + 1 이 point b 가 된다
// i + 2 가 c, i + 3 이 d가 된다
// i + 1 -> i + 2 은 i -> i + 1 과 맞닿아있어 교차될 수 없으므로 제외한다
if (is_intersection_1.isIntersection(closedPolygon[i], closedPolygon[i + 1], closedPolygon[n], closedPolygon[n + 1])) {
return true;
}
}
}
}
return false;
return false;
}
/***/ })
/******/ ])));
exports.isComplexPolygon = isComplexPolygon;
//# sourceMappingURL=index.js.map
{
"name": "@lunit/is-complex-polygon",
"version": "1.0.4",
"description": "Test is polygon complex",
"author": "Seoyeon Lee <seoyeon.lee@lunit.io>",
"repository": "lunit-io/frontend-components",
"author": "SSen <i@ssen.name>",
"license": "MIT",
"repository": "github:lunit/frontend-components",
"bugs": "https://github.com/lunit/frontend-components/issues",
"homepage": "https://github.com/lunit/frontend-components/tree/master/src/@lunit/is-complex-polygon",
"engines": {
"node": ">=10"
},
"publishConfig": {
"access": "public"
},
"name": "@lunit/is-complex-polygon",
"version": "5.0.0-alpha.1",
"dependencies": {
"@lunit/is-intersection": "^5.0.0-alpha.1"
},
"main": "index.js",
"typings": "index.d.ts",
"dependencies": {
"@lunit/is-intersection": "^1.0.0"
}
"typings": "index.d.ts"
}
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