Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Filter over async iterables.
This method creates a new async iterable with all elements that pass the test implemented by the provided function.
This module is part of Async iterable fun, a complete toolset of modules to work with async iterables.
This example read a text file, filtering only chunks containing a new line:
import filter from 'ai-filter';
import { createReadStream } from "fs";
const stream = createReadStream(`file.txt`, "utf8");
const result = filter(chunk => chunk.contains('\n'), fromStream(stream))
for await (const chunk of result) {
console.log(chunk);
}
The filter() method creates a new async iterable with all elements that pass the test implemented by the provided function.
Parameters
predicate
Function
is a predicate, to test each element of the async iterable. Return true to
keep the element, false otherwise, taking three arguments: element: The current element being processed in the async iterable.
index: The index of the current element being processed in the async iterable.
iterable: The async iterable filter was called upon.
data
AsyncIterable The source async iterable to filter.Returns AsyncIterable A new async iterable with the elements that pass the test.
With npm installed, run
npm install --save ai-filter
MIT
FAQs
Filter over async iterables.
The npm package ai-filter receives a total of 0 weekly downloads. As such, ai-filter popularity was classified as not popular.
We found that ai-filter 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.