Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

@xylabs/exists

Package Overview
Dependencies
Maintainers
5
Versions
530
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/exists

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

latest
Source
npmnpm
Version
5.0.100
Version published
Weekly downloads
4.1K
16.37%
Maintainers
5
Weekly downloads
 
Created
Source

@xylabs/exists

npm license

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

Install

Using npm:

npm install {{name}}

Using yarn:

yarn add {{name}}

Using pnpm:

pnpm add {{name}}

Using bun:

bun add {{name}}

License

See the LICENSE file for license rights and limitations (LGPL-3.0-only).

Reference

packages

exists

### .temp-typedoc

  ### functions

    ### <a id="exists"></a>exists

@xylabs/exists

function exists<T>(x?): x is NonNullable<T>;

Used to type narrow an object which is possibly null or undefined. Works well with functional Array methods. For example:

Type Parameters

T

T

Parameters

x?

T | null

The object which is potentially undefined or null

Returns

x is NonNullable<T>

False if the object is null/undefined, true otherwise

Example

const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []

Keywords

exists

FAQs

Package last updated on 22 Apr 2026

Did you know?

Socket

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.

Install

Related posts