@thisisagile/easy 15.4.1 → 15.5.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.
|
@@ -10,3 +10,6 @@ export declare const toName: (subject?: unknown, postfix?: string) => string;
|
|
|
10
10
|
export declare const on: <T>(t: T, f: (t: T) => unknown) => T;
|
|
11
11
|
export declare const use: <T, Out>(t: T, f: (t: T) => Out) => Out;
|
|
12
12
|
export declare const ifA: <T>(c: Constructor<T>, t?: unknown, alt?: unknown) => Optional<T>;
|
|
13
|
+
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
14
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
15
|
+
}[Keys];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.5.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": "15.
|
|
34
|
+
"@thisisagile/easy-test": "15.5.2",
|
|
35
35
|
"@types/form-urlencoded": "^4.4.0",
|
|
36
36
|
"@types/jsonwebtoken": "^9.0.2",
|
|
37
37
|
"@types/luxon": "3.2.0",
|
package/src/types/Constructor.ts
CHANGED
|
@@ -23,3 +23,8 @@ export const on = <T>(t: T, f: (t: T) => unknown): T => {
|
|
|
23
23
|
export const use = <T, Out>(t: T, f: (t: T) => Out): Out => f(t);
|
|
24
24
|
|
|
25
25
|
export const ifA = <T>(c: Constructor<T>, t?: unknown, alt?: unknown): Optional<T> => (!isPrimitive(t) && t instanceof c ? t : alt ? ifA(c, alt) : undefined);
|
|
26
|
+
|
|
27
|
+
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &
|
|
28
|
+
{
|
|
29
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
30
|
+
}[Keys];
|