@naturalcycles/nodejs-lib 12.87.0 → 12.88.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.
@@ -25,3 +25,10 @@ export interface ObjectSchemaTyped<IN, OUT = IN> extends ObjectSchema<IN>, AnySc
25
25
  }
26
26
  export interface StringSchemaTyped extends StringSchema, AnySchemaTyped<string> {
27
27
  }
28
+ /**
29
+ * This type is useful to allow "joi schema merging".
30
+ * Because by default Joi doesn't allow normal merging.
31
+ * E.g `joiSchema.concat` doesn't play well when some property exists
32
+ * in both left and right side.
33
+ */
34
+ export type JoiSchemaObject<T> = Partial<Record<keyof T, any>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
- "version": "12.87.0",
3
+ "version": "12.88.0",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "docs-serve": "vuepress dev docs",
@@ -42,3 +42,11 @@ export interface ObjectSchemaTyped<IN, OUT = IN>
42
42
  extends ObjectSchema<IN>,
43
43
  AnySchemaTyped<IN, OUT> {}
44
44
  export interface StringSchemaTyped extends StringSchema, AnySchemaTyped<string> {}
45
+
46
+ /**
47
+ * This type is useful to allow "joi schema merging".
48
+ * Because by default Joi doesn't allow normal merging.
49
+ * E.g `joiSchema.concat` doesn't play well when some property exists
50
+ * in both left and right side.
51
+ */
52
+ export type JoiSchemaObject<T> = Partial<Record<keyof T, any>>