
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
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.
@3dsource/utils
Advanced tools
A comprehensive collection of utility functions and helpers for 3dsource projects. This library provides common functionality used across different 3dsource applications and libraries.
The utils library offers a wide range of utility functions organized by category:
This library requires the following peer dependencies:
{
"rxjs": "^7.8.2",
"ts-md5": "^1.3.1",
"uuid": "^11.1.0"
}
npm i @3dsource/utils
Import the specific utility functions you need:
import { hexToRgb } from '@3dsource/utils/color';
import { clamp } from '@3dsource/utils/math';
import { generateUUID } from '@3dsource/utils/helpers';
The color module provides functions for working with colors:
import { hexToRgb, rgbToHex, darken, lighten } from '@3dsource/utils/color';
// Convert hex color to RGB
const rgb = hexToRgb('#ff0000'); // { r: 255, g: 0, b: 0 }
// Convert RGB to hex
const hex = rgbToHex(255, 0, 0); // '#ff0000'
// Darken a color by 20%
const darkRed = darken('#ff0000', 0.2);
The math module provides mathematical functions:
import { clamp, lerp, degToRad } from '@3dsource/utils/math';
// Clamp a value between min and max
const clampedValue = clamp(150, 0, 100); // 100
// Linear interpolation
const interpolated = lerp(0, 100, 0.5); // 50
// Convert degrees to radians
const radians = degToRad(180); // 3.14159...
The geom module provides geometry-related functions:
import { calculateDistance, isPointInPolygon } from '@3dsource/utils/geom';
// Calculate distance between two points
const distance = calculateDistance({ x: 0, y: 0 }, { x: 3, y: 4 }); // 5
import { generateUUID, isValidUUID } from '@3dsource/utils/helpers';
// Generate a new UUID
const id = generateUUID();
// Check if a string is a valid UUID
const isValid = isValidUUID(id); // true
import { retryWithBackoff } from '@3dsource/utils/rxjs';
import { of, throwError } from 'rxjs';
import { mergeMap } from 'rxjs/operators';
// Retry an operation with exponential backoff
function getData() {
return of(Math.random()).pipe(
mergeMap((val) => (val < 0.5 ? throwError(() => new Error('Failed')) : of(val))),
retryWithBackoff({
initialInterval: 100,
maxRetries: 3,
}),
);
}
FAQs
A set of utils for using in 3dsource projects
We found that @3dsource/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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.

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.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.