
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).
Typesafe immutable datastructure for python. With plenty of methods for fluent functional programming.
Svector (pronounced Swag-tor) provides extension methods to pyrsistent data structures. Easily chain your methods confidently with tons of additional methods. Leverage the latest mypy features to spot errors during coding.
pip install svector
Immutable list replacement for python. With postfix methods for easy functional programming.
With mypy installed, easily spot errors when you call the wrong methods on your sequence.
from svector import Svector
many_strings = Svector.of(["Lucy, Damion, Jon"]) # Svector[str]
many_strings.sum() # Mypy errors with 'Invalid self argument'. You can't sum a sequence of strings!
many_nums = Svector.of([1, 1.2])
assert many_nums.sum() == 2.2 # ok!
class CannotSortMe:
def __init__(self, value: int):
self.value: int = value
stuff = Svector.of([CannotSortMe(value=1), CannotSortMe(value=1)])
stuff.sort_by(lambda x: x) # Mypy errors with 'Cannot be "CannotSortMe"'. You can't sort by the class itself
stuff.sort_by(lambda x: x.value) # ok! You can sort by the value
Svector.of([{"i am a dict": "value"}]).distinct_by(
lambda x: x
) # Mypy errors with 'Cannot be Dict[str, str]. You can't hash a dict itself
Svector provides methods that you can chain easily for easier data processing.
from svector import Svector
Svector.of([-1, 0, 1]).map(
lambda x: x if x >= 0 else None).flatten_option() # Mypy infers Svector[int] correctly
result = (
Svector.of(i for i in range(5000))
.map(lambda x: (x % 3, x))
.filter(lambda x: x[0] == 0)
.for_each_enumerate(lambda idx, element: print(f"{idx}: {element}"))
.take(5)
)
FAQs
Typesafe immutable datastructure for python. With plenty of methods for fluent functional programming.
We found that svector 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.