
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
A library of higher order functions that is immutable, minimalist and versatile
This module is still under internal development. We are working on:
filter(obj, fn(val, key))
reject(obj, fn(val, key))
map(obj, fn(val, key))
remap(obj, fn(val, key))
shuffle(arr)
sortBy(arr, key, desc?)
toPairs(obj)
fromPairs(arr)
groupBy(arr, keyFn, valFn)
Let's try to make it compatible with both CommonJS and ES6 module systems, with the following emphasis:
Possible usage patterns are:
const { filter, reject } = require('2belt');
const filter = require('2belt/filter');
const belt = require('2belt');
import * as belt from '2belt/es';
import { filter, reject } from '2belt/es';
If we ever decide to use module names like Enum, List etc, it would become
const { Enum, List } = require('2belt');
const { filter, reject } = require('2belt/Enum');
const Enum = require('2belt/Enum');
const filter = require('2belt/Enum/filter');
import { Enum, List } from '2belt/es';
For a standard library, making the user import each function individually is somewhat inconvenient. For example, if there are only 4 modules total, the user can always just import those 4 modules and be done, like in Elixir. The downside of housing the functions under modules is that the user has to search through the different modules for a function. Also it is somewhat convenient to have functions that work across different object types.
Decision:
import * as belt from '2belt/es';
FAQs
Useful utility functions with strong FP support
We found that 2belt 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.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.