@clipboard-health/util-ts 1.1.0 → 1.2.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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.2.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.1.0...util-ts-1.2.0) (2024-05-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add more utils ([#624](https://github.com/ClipboardHealth/cbh-core/issues/624)) ([282ec68](https://github.com/ClipboardHealth/cbh-core/commit/282ec68d285ac0007032eb57d5e16177ef380e30))
|
|
11
|
+
|
|
5
12
|
## [1.1.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.0.0...util-ts-1.1.0) (2024-01-24)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Turns a null-returning promise into a promise returning undefined.
|
|
3
|
+
*
|
|
4
|
+
* Some of the database packages that we use return promises (Prisma)
|
|
5
|
+
* or promise-like objects (mongoose) that can resolve to null.
|
|
6
|
+
* This function is useful for getting rid of nulls which are banned by our linter rules.
|
|
7
|
+
*
|
|
8
|
+
* @param value A promise or a promise-like object.
|
|
9
|
+
*/
|
|
10
|
+
export declare function nullToUndefined<T>(value: PromiseLike<T | null>): Promise<T | undefined>;
|
|
2
11
|
//# sourceMappingURL=null-to-undefined.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"null-to-undefined.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/null-to-undefined.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"null-to-undefined.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/null-to-undefined.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAsB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAE7F"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nullToUndefined = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Turns a null-returning promise into a promise returning undefined.
|
|
6
|
+
*
|
|
7
|
+
* Some of the database packages that we use return promises (Prisma)
|
|
8
|
+
* or promise-like objects (mongoose) that can resolve to null.
|
|
9
|
+
* This function is useful for getting rid of nulls which are banned by our linter rules.
|
|
10
|
+
*
|
|
11
|
+
* @param value A promise or a promise-like object.
|
|
12
|
+
*/
|
|
4
13
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
5
14
|
async function nullToUndefined(value) {
|
|
6
15
|
return (await value) ?? undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"null-to-undefined.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/null-to-undefined.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACjD,KAAK,UAAU,eAAe,CAAI,
|
|
1
|
+
{"version":3,"file":"null-to-undefined.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/null-to-undefined.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,wDAAwD;AACjD,KAAK,UAAU,eAAe,CAAI,KAA4B;IACnE,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC;AACpC,CAAC;AAFD,0CAEC"}
|