@xylabs/exists 2.11.3 → 2.11.4
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/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* @param x The object which is potentially undefined or null
|
|
7
7
|
* @returns False if the object is null/undefined, true otherwise
|
|
8
8
|
*/
|
|
9
|
-
export declare const exists: <T>(x?: T
|
|
9
|
+
export declare const exists: <T>(x?: T) => x is T;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,sBAElB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* @param x The object which is potentially undefined or null
|
|
7
7
|
* @returns False if the object is null/undefined, true otherwise
|
|
8
8
|
*/
|
|
9
|
-
export declare const exists: <T>(x?: T
|
|
9
|
+
export declare const exists: <T>(x?: T) => x is T;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,sBAElB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
|
13
17
|
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
exists
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
const exists = (x) => {
|
|
10
|
-
return x === undefined || x === null ? false : true;
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var exists = (x) => {
|
|
3
|
+
return x === void 0 || x === null ? false : true;
|
|
11
4
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
export {
|
|
6
|
+
exists
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"esm"
|
|
49
49
|
],
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
52
|
-
"@xylabs/tsconfig": "^3.0.
|
|
51
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.20",
|
|
52
|
+
"@xylabs/tsconfig": "^3.0.20",
|
|
53
53
|
"typescript": "^5.2.2"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
61
61
|
},
|
|
62
62
|
"sideEffects": false,
|
|
63
|
-
"version": "2.11.
|
|
63
|
+
"version": "2.11.4"
|
|
64
64
|
}
|