@thisisagile/easy 12.18.8 → 12.18.9
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/utils/If.d.ts +1 -1
- package/dist/utils/If.js +1 -1
- package/dist/utils/If.js.map +1 -1
- package/package.json +2 -2
- package/src/utils/If.ts +2 -1
package/dist/utils/If.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { Construct } from '../types';
|
|
|
2
2
|
export declare const ifTrue: <T>(o: unknown, f: Construct<T>, alt?: Construct<T> | undefined) => T | undefined;
|
|
3
3
|
export declare const ifFalse: <T>(o: unknown, f: Construct<T>, alt?: Construct<T> | undefined) => T | undefined;
|
|
4
4
|
export declare const ifDefined: <T>(o: unknown, f: Construct<T>, alt?: Construct<T> | undefined) => T | undefined;
|
|
5
|
-
export declare const ifNotEmpty: <T>(o: unknown, f
|
|
5
|
+
export declare const ifNotEmpty: <T>(o: unknown, f?: Construct<T>, alt?: Construct<T> | undefined) => T | undefined;
|
package/dist/utils/If.js
CHANGED
|
@@ -8,6 +8,6 @@ const ifFalse = (o, f, alt) => (!(0, types_1.isTrue)(o) ? (0, types_1.ofConstruc
|
|
|
8
8
|
exports.ifFalse = ifFalse;
|
|
9
9
|
const ifDefined = (o, f, alt) => ((0, types_1.isDefined)(o) ? (0, types_1.ofConstruct)(f, o) : (0, types_1.ofConstruct)(alt, o));
|
|
10
10
|
exports.ifDefined = ifDefined;
|
|
11
|
-
const ifNotEmpty = (o, f, alt) => (
|
|
11
|
+
const ifNotEmpty = (o, f = o => o, alt) => (0, types_1.isNotEmpty)(o) ? (0, types_1.ofConstruct)(f, o) : (0, types_1.ofConstruct)(alt, o);
|
|
12
12
|
exports.ifNotEmpty = ifNotEmpty;
|
|
13
13
|
//# sourceMappingURL=If.js.map
|
package/dist/utils/If.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"If.js","sourceRoot":"","sources":["../../src/utils/If.ts"],"names":[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,CAAC,CAAC,CAAC,CAAC;AAAtI,QAAA,MAAM,UAAgI;AAC5I,MAAM,OAAO,GAAG,CAAI,CAAU,EAAE,CAAe,EAAE,GAAkB,EAAiB,EAAE,CAAC,CAAC,CAAC,IAAA,cAAM,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAAxI,QAAA,OAAO,WAAiI;AAC9I,MAAM,SAAS,GAAG,CAAI,CAAU,EAAE,CAAe,EAAE,GAAkB,EAAiB,EAAE,CAAC,CAAC,IAAA,iBAAS,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAA5I,QAAA,SAAS,aAAmI;AAClJ,MAAM,UAAU,GAAG,CAAI,CAAU,EAAE,IAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAkB,EAAiB,EAAE,CACvG,IAAA,kBAAU,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAD7C,QAAA,UAAU,cACmC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "12.18.
|
|
3
|
+
"version": "12.18.9",
|
|
4
4
|
"description": "Straightforward library for building domain-driven microservice architectures",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@thisisagile/easy-test": "12.18.
|
|
34
|
+
"@thisisagile/easy-test": "12.18.9",
|
|
35
35
|
"@types/form-urlencoded": "^4.4.0",
|
|
36
36
|
"@types/jsonwebtoken": "^8.5.9",
|
|
37
37
|
"@types/luxon": "3.1.0",
|
package/src/utils/If.ts
CHANGED
|
@@ -3,4 +3,5 @@ import { Construct, isDefined, isNotEmpty, isTrue, ofConstruct } from '../types'
|
|
|
3
3
|
export const ifTrue = <T>(o: unknown, f: Construct<T>, alt?: Construct<T>): T | undefined => (isTrue(o) ? ofConstruct(f, o) : ofConstruct(alt, o));
|
|
4
4
|
export const ifFalse = <T>(o: unknown, f: Construct<T>, alt?: Construct<T>): T | undefined => (!isTrue(o) ? ofConstruct(f, o) : ofConstruct(alt, o));
|
|
5
5
|
export const ifDefined = <T>(o: unknown, f: Construct<T>, alt?: Construct<T>): T | undefined => (isDefined(o) ? ofConstruct(f, o) : ofConstruct(alt, o));
|
|
6
|
-
export const ifNotEmpty = <T>(o: unknown, f: Construct<T
|
|
6
|
+
export const ifNotEmpty = <T>(o: unknown, f: Construct<T> = o => o, alt?: Construct<T>): T | undefined =>
|
|
7
|
+
isNotEmpty(o) ? ofConstruct(f, o) : ofConstruct(alt, o);
|