// npm package
@antv/g-plugin-matterjs
A G plugin for matter.js physics engine
versions
204
maintainers
51
license
MIT
first publish
2022-03-04
publisher
wang1212
tarball
743,316 B
AUTO-PUBLISHED·1 version indexed·latest published 2025-12-24
// publisher campaignby wang1212
9 caught packages from this accountThis is not an isolated catch. The same publisher has shipped 8 other packages that our pipeline flagged — the shape of a coordinated campaign, not a one-off. Each link below opens that sibling's analysis.
// offending code· @2.1.1· 1 file flagged
llm: benign · 0.85→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s), 1 other host(s).
- @2.1.1··AUTO-PUBLISHED·publisher: wang1212heuristic 75/100static flags 1llm benign (0.85) via ollamamature-packageosv-flagged:MAL-2026-3948public-github-push
→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s), 1 other host(s).
// offending code· 1 file flaggedpatterns: 1
--- package/package.json (excerpt) --- { "name": "@antv/g-plugin-matterjs", "version": "2.1.1", "description": "A G plugin for matter.js physics engine", "keywords": [ "antv", "g" ], "homepage": "https://github.com/antvis/g#readme", "bugs": { "url": "https://github.com/antvis/g/issues" }, "repository": { "type": "git", "url": "git+https://github.com/antvis/g.git" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "exports": { "types": "./types/index.d.ts", "import": "./dist/index.esm.js", "default": "./dist/index.js" }, "main": "dist/index.js", "unpkg": "dist/index.umd.min.js", "module": "dist/index.esm.js", "types": "types/index.d.ts", "files": [ "package.json", "dist", "types", "LICENSE", "README.md" ], "dependencies": { "@babel/runtime": "^7.25.6", "gl-matrix": "^3.4.3", "matter-js": "^0.18.0", "tslib": "^2.5.3", "@antv/g-lite": "2.7.0" }, "devDependencies": { "@types/matter-js": "^0.17.7" }, "publishConfig": { "access": "public" }, "scripts": { "build:js": "rimraf dist && rollup -c", "build:types": "rimraf types && tsc --emitDeclarationOnly --noCheck", "build": "npm run build:js && npm run build:types", "sync": "tnpm sync", "watch": "rollup -c -w" } } --- package.json (entry) --- { "name": "@antv/g-plugin-matterjs", "version": "2.1.1", "description": "A G plugin for matter.js physics engine", "keywords": [ "antv", "g" ], "homepage": "https://github.com/antvis/g#readme", "bugs": { "url": "https://github.com/antvis/g/issues" }, "repository": { "type": "git", "url": "git+https://github.com/antvis/g.git" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "exports": { "types": "./types/index.d.ts", "import": "./dist/index.esm.js", "default": "./dist/index.js" }, "main": "dist/index.js", "unpkg": "dist/index.umd.min.js", "module": "dist/index.esm.js", "types": "types/index.d.ts", "files": [ "package.json", "dist", "types", "LICENSE", "README.md" ], "dependencies": { "@babel/runtime": "^7.25.6", "gl-matrix": "^3.4.3", "matter-js": "^0.18.0", "tslib": "^2.5.3", "@antv/g-lite": "2.7.0" }, "devDependencies": { "@types/matter-js": "^0.17.7" }, "publishConfig": { "access": "public" }, "scripts": { "build:js": "rimraf dist && rollup -c", "build:types": "rimraf types && tsc --emitDeclarationOnly --noCheck", --- index.js (entry) --- /*! * @antv/g-plugin-matterjs * @description A G plugin for matter.js physics engine * @version 2.1.1 * @date 12/24/2025, 11:56:51 AM * @author AntVis * @docs https://g.antv.antgroup.com/ */ 'use strict'; var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); var _classCallCheck = require('@babel/runtime/helpers/classCallCheck'); var _createClass = require('@babel/runtime/helpers/createClass'); var _callSuper = require('@babel/runtime/helpers/callSuper'); var _inherits = require('@babel/runtime/helpers/inherits'); var gLite = require('@antv/g-lite'); var _slicedToArray = require('@babel/runtime/helpers/slicedToArray'); var glMatrix = require('gl-matrix'); var matterJs = require('matter-js'); /** * @see https://stackoverflow.com/questions/45660743/sort-points-in-counter-clockwise-in-javascript */ function sortPointsInCCW(pts) { var points = pts.map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), x = _ref2[0], y = _ref2[1]; return { x: x, y: y, angle: 0 }; }); points.sort(function (a, b) { return a.y - b.y; }); // Get center y var cy = (points[0].y + points[points.length - 1].y) / 2; // Sort --- bundled output (OSV-MAL flagged — LLM scope expansion) --- --- dist/index.esm.js (bundled) --- /*! * @antv/g-plugin-matterjs * @description A G plugin for matter.js physics engine * @version 2.1.1 * @date 12/24/2025, 11:56:51 AM * @author AntVis * @docs https://g.antv.antgroup.com/ */ import _objectSpread from '@babel/runtime/helpers/objectSpread2'; import _classCallCheck from '@babel/runtime/helpers/classCallCheck'; import _createClass from '@babel/runtime/helpers/createClass'; import _callSuper from '@babel/runtime/helpers/callSuper'; import _inherits from '@babel/runtime/helpers/inherits'; import { ElementEvent, CanvasEvent, AABB, deg2rad, Shape, rad2deg, AbstractRendererPlugin } from '@antv/g-lite'; import _slicedToArray from '@babel/runtime/helpers/slicedToArray'; import { vec2 } from 'gl-matrix'; import { Body, Engine, Render, Bodies, Composite, World } from 'matter-js'; /** * @see https://stackoverflow.com/questions/45660743/sort-points-in-counter-clockwise-in-javascript */ function sortPointsInCCW(pts) { var points = pts.map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), x = _ref2[0], y = _ref2[1]; return { x: x, y: y, angle: 0 }; }); points.sort(function (a, b) { return a.y - b.y; }); // Get center y var cy = (points[0].y + points[points.length - 1].y) / 2; // Sort from right to left points.sort(function (a, b) { return b.x - a.x; }); // Get center x var cx = (points[0].x + points[points.length - 1].x) / 2; // Center point var center = { x: cx, y: cy }; // Pre calculate the angles as it will be slow in the sort // As the points are sorted from right to left the first point // is the rightmost // Starting angle used to reference other angles var startAng; points.forEach(function (point) { var ang = Math.atan2(point.y - center.y, point.x - center.x); if (!startAng) { startAng = ang; } else if (ang < startAng) { // ensure that all points are clockwise of the start point ang += Math.PI * 2; } poin --- dist/index.js (bundled) --- /*! * @antv/g-plugin-matterjs * @description A G plugin for matter.js physics engine * @version 2.1.1 * @date 12/24/2025, 11:56:51 AM * @author AntVis * @docs https://g.antv.antgroup.com/ */ 'use strict'; var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); var _classCallCheck = require('@babel/runtime/helpers/classCallCheck'); var _createClass = require('@babel/runtime/helpers/createClass'); var _callSuper = require('@babel/runtime/helpers/callSuper'); var _inherits = require('@babel/runtime/helpers/inherits'); var gLite = require('@antv/g-lite'); var _slicedToArray = require('@babel/runtime/helpers/slicedToArray'); var glMatrix = require('gl-matrix'); var matterJs = require('matter-js'); /** * @see https://stackoverflow.com/questions/45660743/sort-points-in-counter-clockwise-in-javascript */ function sortPointsInCCW(pts) { var points = pts.map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), x = _ref2[0], y = _ref2[1]; return { x: x, y: y, angle: 0 }; }); points.sort(function (a, b) { return a.y - b.y; }); // Get center y var cy = (points[0].y + points[points.length - 1].y) / 2; // Sort from right to left points.sort(function (a, b) { return b.x - a.x; }); // Get center x var cx = (points[0].x + points[points.length - 1].x) / 2; // Center point var center = { x: cx, y: cy }; // Pre calculate the angles as it will be slow in the sort // As the points are sorted from right to left the first point // is the rightmost // Starting angle used to reference other angles var startAng; points.forEach(function (point) { var ang = Math.atan2(point.y - center.y, point.x - center.x); if (!startAng) { startAng = ang; } else if (ang < startAng) { // ensure that all points are clockwise of the start point ang += Math.PI * 2; } point.angle = ang; // add the angle to the point }); // Sort clockwise; poin --- dist/index.umd.min.js (bundled) --- /*! * @antv/g-plugin-matterjs * @description A G plugin for matter.js physics engine * @version 2.1.1 * @date 12/24/2025, 11:56:51 AM * @author AntVis * @docs https://g.antv.antgroup.com/ */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).G=e.G||{},e.G.MatterJS={}),e.window.G)}(this,function(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function o(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;t.length>n;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}ca
