aboutsummaryrefslogtreecommitdiff
path: root/util/types.ts
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-07-01 16:37:50 +0200
committerlonkaars <loek@pipeframe.xyz>2023-07-01 16:37:50 +0200
commitce9e0788317b25e5d297ed38d9fed0754a341288 (patch)
tree29563a39c73ded16cd93eb7b5c5664d1ece944ac /util/types.ts
parent8ff39cbe6300ca479584fe7d85ff03a1f65bc9b0 (diff)
WIP sentence API
Diffstat (limited to 'util/types.ts')
-rw-r--r--util/types.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/types.ts b/util/types.ts
new file mode 100644
index 0000000..f03a242
--- /dev/null
+++ b/util/types.ts
@@ -0,0 +1,8 @@
+/**
+ * @type DeepPartial<T> makes all properties of type T optional, but keep
+ * array types intact
+ */
+export type DeepPartial<T> = {
+ [K in keyof T]?: T[K] extends Array<infer U> ? Array<U> : DeepPartial<T[K]>;
+};
+