@xylabs/exists 3.1.13 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/index.cjs +29 -0
- package/dist/neutral/index.cjs.map +1 -0
- package/dist/neutral/index.d.cts +10 -0
- package/dist/neutral/index.d.cts.map +1 -0
- package/dist/neutral/index.d.mts +10 -0
- package/dist/neutral/index.d.mts.map +1 -0
- package/dist/neutral/index.d.ts +10 -0
- package/dist/neutral/index.d.ts.map +1 -0
- package/dist/neutral/index.js +8 -0
- package/dist/neutral/index.js.map +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
exists: () => exists
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
var exists = (x) => {
|
|
27
|
+
return x === void 0 || x === null ? false : true;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * Used to type narrow an object which is possibly null or undefined. Works well\n * with functional Array methods. For example:\n * @example\n * const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []\n * @param x The object which is potentially undefined or null\n * @returns False if the object is null/undefined, true otherwise\n */\nexport const exists = <T>(x?: T | null): x is T => {\n return x === undefined || x === null ? false : true\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,IAAM,SAAS,CAAI,MAAyB;AACjD,SAAO,MAAM,UAAa,MAAM,OAAO,QAAQ;AACjD;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to type narrow an object which is possibly null or undefined. Works well
|
|
3
|
+
* with functional Array methods. For example:
|
|
4
|
+
* @example
|
|
5
|
+
* const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []
|
|
6
|
+
* @param x The object which is potentially undefined or null
|
|
7
|
+
* @returns False if the object is null/undefined, true otherwise
|
|
8
|
+
*/
|
|
9
|
+
export declare const exists: <T>(x?: T | null) => x is T;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,UAAW,CAAC,GAAG,IAAI,WAErC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to type narrow an object which is possibly null or undefined. Works well
|
|
3
|
+
* with functional Array methods. For example:
|
|
4
|
+
* @example
|
|
5
|
+
* const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []
|
|
6
|
+
* @param x The object which is potentially undefined or null
|
|
7
|
+
* @returns False if the object is null/undefined, true otherwise
|
|
8
|
+
*/
|
|
9
|
+
export declare const exists: <T>(x?: T | null) => x is T;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,UAAW,CAAC,GAAG,IAAI,WAErC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to type narrow an object which is possibly null or undefined. Works well
|
|
3
|
+
* with functional Array methods. For example:
|
|
4
|
+
* @example
|
|
5
|
+
* const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []
|
|
6
|
+
* @param x The object which is potentially undefined or null
|
|
7
|
+
* @returns False if the object is null/undefined, true otherwise
|
|
8
|
+
*/
|
|
9
|
+
export declare const exists: <T>(x?: T | null) => x is T;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,UAAW,CAAC,GAAG,IAAI,WAErC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * Used to type narrow an object which is possibly null or undefined. Works well\n * with functional Array methods. For example:\n * @example\n * const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []\n * @param x The object which is potentially undefined or null\n * @returns False if the object is null/undefined, true otherwise\n */\nexport const exists = <T>(x?: T | null): x is T => {\n return x === undefined || x === null ? false : true\n}\n"],"mappings":";AAQO,IAAM,SAAS,CAAI,MAAyB;AACjD,SAAO,MAAM,UAAa,MAAM,OAAO,QAAQ;AACjD;","names":[]}
|
package/package.json
CHANGED
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
16
|
"require": {
|
|
17
|
-
"types": "./dist/
|
|
18
|
-
"default": "./dist/
|
|
17
|
+
"types": "./dist/neutral/index.d.cts",
|
|
18
|
+
"default": "./dist/neutral/index.cjs"
|
|
19
19
|
},
|
|
20
20
|
"import": {
|
|
21
|
-
"types": "./dist/
|
|
22
|
-
"default": "./dist/
|
|
21
|
+
"types": "./dist/neutral/index.d.mts",
|
|
22
|
+
"default": "./dist/neutral/index.js"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
|
-
"main": "./dist/
|
|
28
|
-
"types": "./dist/
|
|
29
|
-
"module": "./dist/
|
|
27
|
+
"main": "./dist/neutral/index.cjs",
|
|
28
|
+
"types": "./dist/neutral/index.d.ts",
|
|
29
|
+
"module": "./dist/neutral/index.js",
|
|
30
30
|
"homepage": "https://xylabs.com",
|
|
31
31
|
"keywords": [
|
|
32
32
|
"exists",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"esm"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
40
|
-
"@xylabs/tsconfig": "^3.
|
|
39
|
+
"@xylabs/ts-scripts-yarn3": "^3.10.0",
|
|
40
|
+
"@xylabs/tsconfig": "^3.10.0",
|
|
41
41
|
"typescript": "^5.4.5"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
52
52
|
},
|
|
53
53
|
"sideEffects": false,
|
|
54
|
-
"version": "3.
|
|
54
|
+
"version": "3.3.0",
|
|
55
55
|
"type": "module"
|
|
56
56
|
}
|