Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
A collection of common runtime predicates that TypeScript actually understands.
npm install aint
import { isNotNull } from 'aint';
// given an array containing null and number values
const array = [1, 2, null]; // ts infers Array<null | number>
// ...remove null values by using isNotNull
const arrayWithoutNull = array.filter(isNotNull); // ts infers Array<number>
It's easy to perform a check using lodash or vanilla JavaScript, e.g.
const array = [1, 2, null].filter(Boolean);
The example above will filter out the null
value as expected (because null
is considered to be faulty).
However, TypeScript will NOT infer the correct type [playground link]. It will understand the type of array as being Array<null | number>
instead of Array<number>
.
aint
provides a simple API to test for predicates, while making TypeScript understand.
Source code contributions are most welcome, as long as the linter is satisfied.
Causaly is building the world's largest biomedical knowledge platform, using technologies such as TypeScript, React and Node.js. Find out more about our openings at https://apply.workable.com/causaly/.
MIT
FAQs
A collection of common runtime predicates that TypeScript actually understands.
The npm package aint receives a total of 6 weekly downloads. As such, aint popularity was classified as not popular.
We found that aint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.