Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@bitty/falsy
Advanced tools
@bitty/falsy
Falsy helper functions and types for TypeScript.
📦 Distributions in ESM, CommonJS, UMD and UMD minified formats.
⚡ Lightweight:
🔋 Bateries included:
🏷 Safe:
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install @bitty/falsy --save
# For Yarn, use the command below.
yarn add @bitty/falsy
This module has a UMD bundle available through JSDelivr and Unpkg CDNs.
<!-- For UNPKG use the code below. -->
<script src="https://unpkg.com/@bitty/falsy"></script>
<!-- For JSDelivr use the code below. -->
<script src="https://cdn.jsdelivr.net/npm/@bitty/falsy"></script>
<script>
// UMD module is exposed through the "isFalsy" global function.
console.log(isFalsy);
//=> "[Function: isFalsy]"
console.log(isFalsy(null));
//=> true
</script>
This module default exports isFalsy
, which is a predicate function that checks if value is falsy.
import isFalsy from '@bitty/pipe';
isFalsy();
isFalsy(null);
isFalsy(undefined);
isFalsy(0);
isFalsy(-0);
isFalsy(0n);
isFalsy(NaN);
isFalsy('');
isFalsy(false);
//=> true
isFalsy('Not empty.');
//=> false
We also exports NonFalsy
and Falsy
types.
Falsy
is simply an union of false
, void
, ''
, 0
, 0n
, null
and undefined
, types.
import { Falsy } from '@bitty/falsy';
let falsy: Falsy;
falsy = false;
falsy = undefined as void;
falsy = '';
falsy = 0;
falsy = 0n;
falsy = null;
falsy = undefined;
falsy = 1;
//=> throws "Type '1' is not assignable to type 'Falsy'.".
NonFalsy<T>
is a type helper that removes falsy types.
import { NonFalsy } from '@bitty/falsy';
type Value = 0 | 1 | 2;
const value: NonFalsy<Value> = 0;
//=> throws "Type '0' is not assignable to type '1 | 2'.".
Released under MIT License.
FAQs
Falsy helper functions and types for TypeScript.
The npm package @bitty/falsy receives a total of 9 weekly downloads. As such, @bitty/falsy popularity was classified as not popular.
We found that @bitty/falsy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.