Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@bitty/nullish
Advanced tools
@bitty/nullish
A pipe function to perform function composition in LTR (Left-To-Right) direction.
📦 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]"
</script>
This module default exports isNullish
, which is a 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 8 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.