
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
new Octree/new Quadtree(array<{[key]}>, <{key?: string = 'coords', transform?: function = x => x, depth?: number = 4}>)add(array<{[key]}>): Add an array of itemsclosest(value): Search for the closest item by key valueremove(value): Remove an item from the tree by key valueimport colorNames from 'color-names';
import { Octree } from 'ktree'; // colors are 3-dimensional, so use Octree
// simple hex-to-rgb (assuming no short formats, else see https://unpkg.com/color-tf/hexToRgb.js)
const hexToRgb = s => [s.slice(-6, -4), s.slice(-4, -2), s.slice(-2)].map(x => parseInt(x, 16));
const colors = Object.entries(colorNames).map(([hex, name]) => ({ name, hex }));
// Octree constructor needs an array of {[key], ...} objects, where key is configurable
// We'll use 'hex' here, and add a 'transform' property to map those 'hex' values to 3D coordinates
const tree = new Octree(colors, { key: 'hex', transform: hexToRgb });
console.log(tree.closest('5544df')); // { name: 'Majorelle Blue', hex: '#6050dc', d2: 273 }
tree.remove('#6050dc');
console.log(tree.closest('5544df')); // { name: 'Iris', hex: '#5a4fcf', d2: 402 }
FAQs
Efficient tree search in k-dimensions
We found that ktree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.