@xylabs/exists 2.10.17 → 2.11.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/index.d.mts +2 -3
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -9
- package/tsup.config.ts +0 -16
package/dist/index.d.mts
CHANGED
|
@@ -6,6 +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
|
-
declare const exists: <T>(x?: T | null | undefined) => x is T;
|
|
10
|
-
|
|
11
|
-
export { exists };
|
|
9
|
+
export declare const exists: <T>(x?: T | null | undefined) => 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,yCAElB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +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
|
-
declare const exists: <T>(x?: T | null | undefined) => x is T;
|
|
10
|
-
|
|
11
|
-
export { exists };
|
|
9
|
+
export declare const exists: <T>(x?: T | null | undefined) => 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,yCAElB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
|
|
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);
|
|
1
|
+
'use strict';
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Used to type narrow an object which is possibly null or undefined. Works well
|
|
5
|
+
* with functional Array methods. For example:
|
|
6
|
+
* @example
|
|
7
|
+
* const payloads: XyoPayload[] = boundWitness._payloads?.filter(exists) || []
|
|
8
|
+
* @param x The object which is potentially undefined or null
|
|
9
|
+
* @returns False if the object is null/undefined, true otherwise
|
|
10
|
+
*/
|
|
11
|
+
const exists = (x) => {
|
|
12
|
+
return x === undefined || x === null ? false : true;
|
|
28
13
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
14
|
+
|
|
15
|
+
exports.exists = exists;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;AAOG;AACI,MAAA,MAAA,GAAY,CAAA,CAAA,KAAA;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
const exists = (x) => {
|
|
10
|
+
return x === undefined || x === null ? false : true;
|
|
4
11
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=index.mjs.map
|
|
12
|
+
|
|
13
|
+
export { exists };
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;AAOG;AACI,MAAA,MAAA,GAAY,CAAA,CAAA,KAAA;;;;;;"}
|
package/package.json
CHANGED
|
@@ -40,10 +40,6 @@
|
|
|
40
40
|
},
|
|
41
41
|
"main": "dist/index.js",
|
|
42
42
|
"module": "dist/index.mjs",
|
|
43
|
-
"scripts": {
|
|
44
|
-
"package-compile": "tsup && publint",
|
|
45
|
-
"package-recompile": "tsup && publint"
|
|
46
|
-
},
|
|
47
43
|
"homepage": "https://xylabs.com",
|
|
48
44
|
"keywords": [
|
|
49
45
|
"xylabs",
|
|
@@ -52,10 +48,8 @@
|
|
|
52
48
|
"esm"
|
|
53
49
|
],
|
|
54
50
|
"devDependencies": {
|
|
55
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
56
|
-
"@xylabs/tsconfig": "^
|
|
57
|
-
"publint": "^0.2.2",
|
|
58
|
-
"tsup": "^7.2.0"
|
|
51
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.0-rc.15",
|
|
52
|
+
"@xylabs/tsconfig": "^3.0.0-rc.15"
|
|
59
53
|
},
|
|
60
54
|
"publishConfig": {
|
|
61
55
|
"access": "public"
|
|
@@ -65,5 +59,5 @@
|
|
|
65
59
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
66
60
|
},
|
|
67
61
|
"sideEffects": false,
|
|
68
|
-
"version": "2.
|
|
62
|
+
"version": "2.11.0"
|
|
69
63
|
}
|
package/tsup.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line import/no-default-export
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
bundle: true,
|
|
6
|
-
cjsInterop: true,
|
|
7
|
-
clean: false,
|
|
8
|
-
dts: {
|
|
9
|
-
entry: ['src/index.ts'],
|
|
10
|
-
},
|
|
11
|
-
entry: ['src/index.ts'],
|
|
12
|
-
format: ['cjs', 'esm'],
|
|
13
|
-
sourcemap: true,
|
|
14
|
-
splitting: false,
|
|
15
|
-
tsconfig: 'tsconfig.build.json',
|
|
16
|
-
})
|