Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@bitty/nullish
Advanced tools
@bitty/nullish
Nullish 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/nullish --save
# For Yarn, use the command below.
yarn add @bitty/nullish
This module has a UMD bundle available through JSDelivr and Unpkg CDNs.
<!-- For UNPKG use the code below. -->
<script src="https://unpkg.com/@bitty/nullish"></script>
<!-- For JSDelivr use the code below. -->
<script src="https://cdn.jsdelivr.net/npm/@bitty/nullish"></script>
<script>
// UMD module is exposed through the "isNullish" global function.
console.log(isNullish);
//=> "[Function: isNullish]"
console.log(isNullish(null));
//=> true
</script>
This module default exports isNullish
, which is a predicate function that checks if value is nullish.
import isNullish from '@bitty/pipe';
isNullish(null);
//=> true
isNullish(undefined);
//=> true
isNullish(undefined as void);
//=> true
isNullish(NaN);
//=> false
We also exports NonNullish
and Nullish
types.
Nullish
is simply an union of null
, void
and undefined
types.
import { Nullish } from '@bitty/nullish';
let nullish: Nullish;
nullish = null;
nullish = undefined;
nullish = undefined as void;
nullish = false;
//=> throws "Type 'false' is not assignable to type 'Nullish'.".
NonNullish<T>
is a type helper that removes nullish types.
import { NonNullish } from '@bitty/nullish';
type Value = string | null | undefined;
const value: NonNullish<Value> = null;
//=> throws "Type 'null' is not assignable to type 'string'.".
Released under MIT License.
FAQs
Nullish helper functions and types for TypeScript.
The npm package @bitty/nullish receives a total of 17 weekly downloads. As such, @bitty/nullish popularity was classified as not popular.
We found that @bitty/nullish 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.