
Research
/Security News
Toptalβs GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptalβs GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Masks fp is a powerful wrapping tool that preserves meta and anatomical information. π
Advanced ⬦ Powerful ⬦ Tooling
Wrapping is a technique targeting function extensibility, taking metadata of one function and merging it with another, including any intended additional functionality, forming a new function.
Mask fp is a powerful tool made for wrapping functions and is built on top of the functools.wraps
function. The masks
function allows for quick creation of wrapper function look-alikes by placing the masks
decorator over target wrapper functions and calling it along with the desired target wrapped function. Furthermore, the masks
function will preserve type hinting, signatures, annotations, and the application of default arg and kwarg values, for an enhanced developer experience and potentially advanced use cases.
__signature__
and __annotations__
for wrappers; parameters of wrapped
and return annotation of wrapper
.Using pip
pip install masks-fp
Or using Poetry
poetry add masks-fp
from collections.abc import Callable, Iterable
from mask_fp import masks
def decorator(f: Callable[..., Iterable[int]]) -> Callable:
@masks(f)
def wrapper(*args, **kwargs) -> dict[str, int | Iterable[int]]:
"""
From ``wrapper`` ``docstring``. π
"""
print(f"Sum of {f(*args, **kwargs)} is {sum(f(*args, **kwargs))}. π")
return f(*args, **kwargs)
return wrapper
@decorator
def wrapped(a: int, /, b: int = 2, *, c: int = 3) -> tuple[int, int, int]:
"""
From ``wrapped`` ``docstring``. π
"""
return (a, b, c)
Without using default values
>>> print(wrapped(1, 2, c=3))
Sum of (1, 2, 3) is 6. π
(1, 2, 3)
Using default values
>>> print(wrapped(1))
Sum of (1, 2, 3) is 6. π
(1, 2, 3)
FAQs
Masks fp is a powerful wrapping tool that preserves meta and anatomical information. π
We found that masks-fp 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
Threat actors hijacked Toptalβs GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.