Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xylabs/exists

Package Overview
Dependencies
Maintainers
7
Versions
221
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/exists - npm Package Compare versions

Comparing version 2.7.6 to 2.8.0

8

dist/cjs/index.js

@@ -5,13 +5,13 @@ "use strict";

/**
* Used to type narrow an object which is possibly undefined. Works well
* Used to type narrow an object which is possibly null or undefined. Works well
* with functional Array methods. For example:
* @example
* const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []
* @param x The object which is potentially undefined
* @returns True if the object is defined, false otherwise
* @param x The object which is potentially undefined or null
* @returns False if the object is null/undefined, true otherwise
*/
const exists = (x) => {
return !!x;
return x === undefined || x === null ? false : true;
};
exports.exists = exists;
//# sourceMappingURL=index.js.map

@@ -20,3 +20,3 @@ {

"character": 13,
"url": "https://github.com/xylabs/sdk-js/blob/8d1441a/packages/exists/src/index.ts#L9"
"url": "https://github.com/xylabs/sdk-js/blob/9ad4029/packages/exists/src/index.ts#L9"
}

@@ -35,3 +35,3 @@ ],

"kind": "text",
"text": "Used to type narrow an object which is possibly undefined. Works well\nwith functional Array methods. For example:"
"text": "Used to type narrow an object which is possibly null or undefined. Works well\nwith functional Array methods. For example:"
}

@@ -54,3 +54,3 @@ ],

"kind": "text",
"text": "True if the object is defined, false otherwise"
"text": "False if the object is null/undefined, true otherwise"
}

@@ -83,3 +83,3 @@ ]

"kind": "text",
"text": "The object which is potentially undefined"
"text": "The object which is potentially undefined or null"
}

@@ -131,5 +131,5 @@ ]

"character": 0,
"url": "https://github.com/xylabs/sdk-js/blob/8d1441a/packages/exists/src/index.ts#L9"
"url": "https://github.com/xylabs/sdk-js/blob/9ad4029/packages/exists/src/index.ts#L9"
}
]
}
/**
* Used to type narrow an object which is possibly undefined. Works well
* Used to type narrow an object which is possibly null or undefined. Works well
* with functional Array methods. For example:
* @example
* const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []
* @param x The object which is potentially undefined
* @returns True if the object is defined, false otherwise
* @param x The object which is potentially undefined or null
* @returns False if the object is null/undefined, true otherwise
*/
export const exists = (x) => {
return !!x;
return x === undefined || x === null ? false : true;
};
//# sourceMappingURL=index.js.map
/**
* Used to type narrow an object which is possibly undefined. Works well
* Used to type narrow an object which is possibly null or undefined. Works well
* with functional Array methods. For example:
* @example
* const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []
* @param x The object which is potentially undefined
* @returns True if the object is defined, false otherwise
* @param x The object which is potentially undefined or null
* @returns False if the object is null/undefined, true otherwise
*/
export declare const exists: <T>(x?: T | null | undefined) => x is T;
//# sourceMappingURL=index.d.ts.map

@@ -44,3 +44,3 @@ {

"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^2.16.1"
"@xylabs/ts-scripts-yarn3": "^2.17.13"
},

@@ -55,3 +55,3 @@ "publishConfig": {

"sideEffects": false,
"version": "2.7.6"
"version": "2.8.0"
}
/**
* Used to type narrow an object which is possibly undefined. Works well
* Used to type narrow an object which is possibly null or undefined. Works well
* with functional Array methods. For example:
* @example
* const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []
* @param x The object which is potentially undefined
* @returns True if the object is defined, false otherwise
* @param x The object which is potentially undefined or null
* @returns False if the object is null/undefined, true otherwise
*/
export const exists = <T>(x?: T | null): x is T => {
return !!x
return x === undefined || x === null ? false : true
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc