// offending code· 3 files flaggedpatterns: 2
--- package/pkg-parallel/antv_layout_wasm.js (excerpt) ---
import { startWorkers } from './snippets/wasm-bindgen-rayon-3e04391371ad0a8e/src/workerHelpers.js';
let wasm;
const heap = new Array(128).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 132) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
return idx;
}
function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedBigInt64Memory0 = null;
function getBigInt64Memory0() {
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.buffer !== wasm.memory.buffer) {
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
}
return cachedBigInt64Memory0;
}
let cachedInt32Memory0 = null;
function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.buffer !== wasm.memory.buffer) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
if (typeof TextDecoder !== 'undefi
--- package/pkg-node/antv_layout_wasm.js (excerpt) ---
let imports = {};
imports['__wbindgen_placeholder__'] = module.exports;
let wasm;
const { TextDecoder, TextEncoder } = require(`util`);
const heap = new Array(128).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 132) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
return idx;
}
function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedFloat64Memory0 = null;
function getFloat64Memory0() {
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}
let cachedInt32Memory0 = null;
function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}
let cachedBigInt64Memory0 = null;
function getBigInt64Memory0() {
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
}
re
--- package/pkg/antv_layout_wasm.js (excerpt) ---
let wasm;
const heap = new Array(128).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 132) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
return idx;
}
function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedFloat64Memory0 = null;
function getFloat64Memory0() {
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}
let cachedInt32Memory0 = null;
function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}
let cachedBigInt64Memory0 = null;
function getBigInt64Memory0() {
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
}
return cachedBigInt64Memory0;
}
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { igno
--- bundled output (OSV-MAL flagged — LLM scope expansion) ---
--- lib/wasm-worker.js (bundled) ---
import { __assign, __awaiter, __generator } from "tslib";
import * as Comlink from "comlink";
var DEFAULT_LAYOUT_OPTIONS = {
dimensions: 2,
chunk_size: 256,
min_movement: 0.4,
distance_threshold_mode: 0,
ka: 0,
kg: 0,
kr: 0,
speed: 0,
prevent_overlapping: false,
kr_prime: 0,
node_radius: 0,
strong_gravity: false,
lin_log: false,
dissuade_hubs: false,
edge_strength: 0,
link_distance: 0,
node_strength: 0,
coulomb_dis_scale: 0,
factor: 0,
interval: 0,
damping: 0,
center: [0, 0],
max_speed: 0,
max_distance: 100.0,
};
var wrapTransfer = function (name, force) {
return function (options) {
var layoutOptions = __assign(__assign({ name: name }, DEFAULT_LAYOUT_OPTIONS), options);
// calculate fruchterman layout options
if (name === 2) {
// @ts-ignore
var area = layoutOptions.width * layoutOptions.height;
var maxDisplace = Math.sqrt(area) / 10;
var k2 = area / (layoutOptions.nodes.length + 1);
var k = Math.sqrt(k2);
layoutOptions.ka = k;
layoutOptions.interval = 0.99;
layoutOptions.damping = maxDisplace;
}
var positions = force(layoutOptions);
return {
// Little perf boost to transfer data to the main thread w/o copying.
nodes: Comlink.transfer(positions, [positions]),
};
};
};
var wrapDagre = function (dagre) {
return function (options) {
var _a = dagre(options), nodes = _a.nodes, edges = _a.edges;
return {
// Little perf boost to transfer data to the main thread w/o copying.
nodes: Comlink.transfer(nodes, [nodes]),
edges: Comlink.transfer(edges, [edges]),
};
};
};
// Wrap wasm-bindgen exports (the `generate` function) to add time measurement.
function wrapExports(_a) {
var force = _a.force, dagre = _a.dagre;
return {
--- dist/26.index.min.js (bundled) ---
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.layoutWASM=e():n.layoutWASM=e()}(self,(()=>(()=>{"use strict";var n={26:(n,e,t)=>{let r,o;const i=new Array(128).fill(void 0);function _(n){return i[n]}i.push(void 0,null,!0,!1);let c=i.length;function u(n){const e=_(n);return function(n){n<132||(i[n]=c,c=n)}(n),e}function b(n){c===i.length&&i.push(i.length+1);const e=c;return c=i[e],i[e]=n,e}function f(n){return null==n}let a=null,s=null;function g(){return null!==s&&s.buffer===o.memory.buffer||(s=new Int32Array(o.memory.buffer)),s}const w="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&w.decode();let l=null;function d(){return null!==l&&l.buffer===o.memory.buffer||(l=new Uint8Array(o.memory.buffer)),l}function y(n,e){return n>>>=0,w.decode(d().slice(n,n+e))}let m=null,p=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},v=function(n,e){const t=h.encode(n);return e.set(t),{read:n.length,written:t.length}};function A(n,e,t){if(void 0===t){const t=h.encode(n),r=e(t.length,1)>>>0;return d().subarray(r,r+t.length).set(t),p=t.length,r}let r=n.length,o=e(r,1)>>>0;const i=d();let _=0;for(;_<r;_++){const e=n.charCodeAt(_);if(e>127)break;i[o+_]=e}if(_!==r){0!==_&&(n=n.slice(_)),o=t(o,r,r=_+3*n.length,1)>>>0;const e=d().subarray(o+_,o+r);_+=v(n,e).written,o=t(o,r,_,1)>>>0}return p=_,o}function x(n){const e=typeof n;if("number"==e||"boolean"==e||null==n)return`${n}`;if("string"==e)return`"${n}"`;if("symbol"==e){const e=n.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=n.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){const e=n.length;let t="[";e>0&&(t+=x(n[0]));for(let r=1;r<e;r++)t+=", "+x(n[r]);ret
--- dist/403.index.min.js (bundled) ---
"use strict";(self.webpackChunklayoutWASM=self.webpackChunklayoutWASM||[]).push([[403],{403:(n,e,t)=>{let r;t.r(e),t.d(e,{dagre:()=>W,default:()=>T,force:()=>S,initSync:()=>E,start:()=>x});const o=new Array(128).fill(void 0);function i(n){return o[n]}o.push(void 0,null,!0,!1);let c=o.length;function _(n){const e=i(n);return function(n){n<132||(o[n]=c,c=n)}(n),e}function u(n){c===o.length&&o.push(o.length+1);const e=c;return c=o[e],o[e]=n,e}function b(n){return null==n}let f=null,a=null;function g(){return null!==a&&0!==a.byteLength||(a=new Int32Array(r.memory.buffer)),a}let w=null;const s="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&s.decode();let l=null;function d(){return null!==l&&0!==l.byteLength||(l=new Uint8Array(r.memory.buffer)),l}function y(n,e){return n>>>=0,s.decode(d().subarray(n,n+e))}let m=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},p="function"==typeof h.encodeInto?function(n,e){return h.encodeInto(n,e)}:function(n,e){const t=h.encode(n);return e.set(t),{read:n.length,written:t.length}};function A(n,e,t){if(void 0===t){const t=h.encode(n),r=e(t.length,1)>>>0;return d().subarray(r,r+t.length).set(t),m=t.length,r}let r=n.length,o=e(r,1)>>>0;const i=d();let c=0;for(;c<r;c++){const e=n.charCodeAt(c);if(e>127)break;i[o+c]=e}if(c!==r){0!==c&&(n=n.slice(c)),o=t(o,r,r=c+3*n.length,1)>>>0;const e=d().subarray(o+c,o+r);c+=p(n,e).written,o=t(o,r,c,1)>>>0}return m=c,o}function v(n){const e=typeof n;if("number"==e||"boolean"==e||null==n)return`${n}`;if("string"==e)return`"${n}"`;if("symbol"==e){const e=n.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=n.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){const e=n.length;let t="[";e>0&&(t+=v(n[0]));for(let r=1;r<e;r++)t+=", "+v(n[r]);return t+="]"
--- dist/658.index.min.js (bundled) ---
/*! For license information please see 658.index.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.layoutWASM=t():e.layoutWASM=t()}(self,(()=>(()=>{"use strict";var e={},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.m=e,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".index.min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var a=r.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=r[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{n.b=self.location+"";var e={658:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunklayoutWASM=self.webpackChunklayoutWASM||[],r=t.push.bind(t);t.push=t=>{var[a,o,i]=t;for(var s in o)n.o(o,s)&&(n.m[s]=o[s]);for(i&&i(n);a.length;)e[a.pop()]=1;r(t)}})();const r=Symbol("Comlink.proxy"),a=Symbol("Comlink.endpoint"),o=Symbol("Comlink.rel