@thisisagile/easy 10.2.1 → 10.2.2

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.
@@ -1,5 +1,5 @@
1
1
  import { Func } from './Func';
2
- export declare type Get<T = any, Args = any> = T | Func<T, Args>;
2
+ export declare type Get<T = any, Args = any> = Func<T, Args> | T;
3
3
  export declare type Predicate<Args = unknown> = Get<boolean, Args>;
4
4
  export declare const ofGet: <T, Args = any>(g: Get<T, Args>, ...args: Args[]) => T;
5
5
  export declare const ifGet: <T>(pred: Get, valid: Get<T, any>, invalid: Get<T, any>) => T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisisagile/easy",
3
- "version": "10.2.1",
3
+ "version": "10.2.2",
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": "10.2.1",
34
+ "@thisisagile/easy-test": "10.2.2",
35
35
  "@types/form-urlencoded": "^4.4.0",
36
36
  "@types/jsonwebtoken": "^8.5.8",
37
37
  "@types/validator": "^13.7.2"
package/src/types/Get.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Func, isFunc } from './Func';
2
2
 
3
- export type Get<T = any, Args = any> = T | Func<T, Args>;
3
+ export type Get<T = any, Args = any> = Func<T, Args> | T;
4
4
  export type Predicate<Args = unknown> = Get<boolean, Args>;
5
5
  export const ofGet = <T, Args = any>(g: Get<T, Args>, ...args: Args[]): T => (isFunc<T, Args>(g) ? g(...args) : g);
6
6
  export const ifGet = <T>(pred: Get, valid: Get<T>, invalid: Get<T>): T => (ofGet(pred) ? ofGet(valid) : ofGet(invalid));