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

@lunit/is-intersection

Package Overview
Dependencies
Maintainers
7
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lunit/is-intersection - npm Package Compare versions

Comparing version 1.0.4 to 5.0.0-alpha.1

index.js.map

124

index.js

@@ -1,94 +0,4 @@

(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 = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIntersection", function() { return isIntersection; });
Object.defineProperty(exports, "__esModule", { value: true });
exports.isIntersection = void 0;
/**

@@ -102,15 +12,19 @@ * ab 와 cd 가 교차하는지 판정

function isIntersection(a, b, c, d) {
if (Math.max(a[0], b[0]) <= Math.min(c[0], d[0])) return false;
if (Math.min(a[0], b[0]) >= Math.max(c[0], d[0])) return false;
if (Math.max(a[1], b[1]) <= Math.min(c[1], d[1])) return false;
if (Math.min(a[1], b[1]) >= Math.max(c[1], d[1])) return false;
const sign1 = (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]);
const sign2 = (b[0] - a[0]) * (d[1] - a[1]) - (d[0] - a[0]) * (b[1] - a[1]);
const sign3 = (d[0] - c[0]) * (a[1] - c[1]) - (a[0] - c[0]) * (d[1] - c[1]);
const sign4 = (d[0] - c[0]) * (b[1] - c[1]) - (b[0] - c[0]) * (d[1] - c[1]);
if (sign1 === 0 && sign2 === 0 && sign3 === 0 && sign4 === 0) return true;
return sign1 * sign2 < 0 && sign3 * sign4 < 0;
if (Math.max(a[0], b[0]) <= Math.min(c[0], d[0]))
return false;
if (Math.min(a[0], b[0]) >= Math.max(c[0], d[0]))
return false;
if (Math.max(a[1], b[1]) <= Math.min(c[1], d[1]))
return false;
if (Math.min(a[1], b[1]) >= Math.max(c[1], d[1]))
return false;
const sign1 = (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]);
const sign2 = (b[0] - a[0]) * (d[1] - a[1]) - (d[0] - a[0]) * (b[1] - a[1]);
const sign3 = (d[0] - c[0]) * (a[1] - c[1]) - (a[0] - c[0]) * (d[1] - c[1]);
const sign4 = (d[0] - c[0]) * (b[1] - c[1]) - (b[0] - c[0]) * (d[1] - c[1]);
if (sign1 === 0 && sign2 === 0 && sign3 === 0 && sign4 === 0)
return true;
return sign1 * sign2 < 0 && sign3 * sign4 < 0;
}
/***/ })
/******/ ])));
exports.isIntersection = isIntersection;
//# sourceMappingURL=index.js.map
{
"name": "@lunit/is-intersection",
"version": "1.0.4",
"description": "Test are two points intersection",
"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-intersection",
"engines": {
"node": ">=10"
},
"publishConfig": {
"access": "public"
},
"name": "@lunit/is-intersection",
"version": "5.0.0-alpha.1",
"dependencies": {},
"main": "index.js",
"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