
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
adaptive-set
Advanced tools
Utils for implementing a Set data structure that dynamically adjusts its internal representation based on the number of elements it contains.
A set of utils for implementing specialized Set
data structure designed to optimize memory usage and performance based on the number of elements it contains.
It adapts its internal representation to efficiently handle cases where there are no items, a single item, or multiple items.
undefined
value to represent the absence of elements, minimizing memory usage.[item]
to store the single element, providing quick access and iteration.Set
to leverage its efficient handling of multiple elements.This adaptive approach ensures that the it remains efficient and performant across different usage scenarios, making it an ideal choice for applications where the number of elements can vary significantly.
npm add adaptive-set
import { add, has, remove, size, type AdaptiveSet } from "adaptive-set";
type Fn = () => void;
class MyClass {
private listeners?: AdaptiveSet<Fn>;
public notify(): void {
if (this.listeners) {
for (const listener of this.listeners) {
listener();
}
}
}
public addListener(listener: Fn): void {
this.listeners = add(this.listeners, listener);
}
public removeListener(listener: Fn): void {
this.listeners = remove(this.listeners, listener);
}
public hasListener(listener: Fn): boolean {
return has(this.listeners, listener);
}
public getListenerCount(): number {
return size(this.listeners);
}
public clearListeners(): void {
this.listeners = undefined;
}
}
FAQs
Utils for implementing a Set data structure that dynamically adjusts its internal representation based on the number of elements it contains.
The npm package adaptive-set receives a total of 608 weekly downloads. As such, adaptive-set popularity was classified as not popular.
We found that adaptive-set demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.