@naturalcycles/nodejs-lib 15.61.0 → 15.61.1
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.
|
@@ -396,10 +396,10 @@ declare function withEnumKeys<const T extends readonly (string | number)[] | Str
|
|
|
396
396
|
} : {
|
|
397
397
|
[P in K]: SchemaOut<S>;
|
|
398
398
|
}, false>;
|
|
399
|
-
type Expand<T> =
|
|
400
|
-
[K in keyof
|
|
401
|
-
}
|
|
402
|
-
type ExactMatch<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
|
|
399
|
+
type Expand<T> = {
|
|
400
|
+
[K in keyof T]: T[K];
|
|
401
|
+
};
|
|
402
|
+
type ExactMatch<A, B> = (<T>() => T extends Expand<A> ? 1 : 2) extends <T>() => T extends Expand<B> ? 1 : 2 ? (<T>() => T extends Expand<B> ? 1 : 2) extends <T>() => T extends Expand<A> ? 1 : 2 ? true : false : false;
|
|
403
403
|
type BuilderOutUnion<B extends readonly JsonSchemaAnyBuilder<any, any, any>[]> = {
|
|
404
404
|
[K in keyof B]: B[K] extends JsonSchemaAnyBuilder<any, infer O, any> ? O : never;
|
|
405
405
|
}[number];
|
|
@@ -586,7 +586,7 @@ export class JsonSchemaObjectBuilder extends JsonSchemaAnyBuilder {
|
|
|
586
586
|
return this.cloneAndUpdateSchema({ additionalProperties: true });
|
|
587
587
|
}
|
|
588
588
|
extend(props) {
|
|
589
|
-
const clone = this.
|
|
589
|
+
const clone = this.clone();
|
|
590
590
|
const incomingSchemaBuilder = new JsonSchemaObjectBuilder(props);
|
|
591
591
|
mergeJsonSchemaObjects(clone.schema, incomingSchemaBuilder.schema);
|
|
592
592
|
return clone;
|
package/package.json
CHANGED
|
@@ -831,11 +831,7 @@ export class JsonSchemaObjectBuilder<
|
|
|
831
831
|
extend<IN2 extends AnyObject>(
|
|
832
832
|
props: AnyObject,
|
|
833
833
|
): JsonSchemaObjectBuilder<IN & IN2, OUT & IN2, Opt> {
|
|
834
|
-
const clone = this.
|
|
835
|
-
IN & IN2,
|
|
836
|
-
OUT & IN2,
|
|
837
|
-
Opt
|
|
838
|
-
>
|
|
834
|
+
const clone = this.clone() as JsonSchemaObjectBuilder<IN & IN2, OUT & IN2, Opt>
|
|
839
835
|
|
|
840
836
|
const incomingSchemaBuilder = new JsonSchemaObjectBuilder<IN2, IN2, false>(props)
|
|
841
837
|
mergeJsonSchemaObjects(clone.schema as any, incomingSchemaBuilder.schema as any)
|
|
@@ -1311,10 +1307,14 @@ function withEnumKeys<
|
|
|
1311
1307
|
>(props, { hasIsOfTypeCheck: false })
|
|
1312
1308
|
}
|
|
1313
1309
|
|
|
1314
|
-
type Expand<T> =
|
|
1310
|
+
type Expand<T> = { [K in keyof T]: T[K] }
|
|
1315
1311
|
|
|
1316
1312
|
type ExactMatch<A, B> =
|
|
1317
|
-
(<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2
|
|
1313
|
+
(<T>() => T extends Expand<A> ? 1 : 2) extends <T>() => T extends Expand<B> ? 1 : 2
|
|
1314
|
+
? (<T>() => T extends Expand<B> ? 1 : 2) extends <T>() => T extends Expand<A> ? 1 : 2
|
|
1315
|
+
? true
|
|
1316
|
+
: false
|
|
1317
|
+
: false
|
|
1318
1318
|
|
|
1319
1319
|
type BuilderOutUnion<B extends readonly JsonSchemaAnyBuilder<any, any, any>[]> = {
|
|
1320
1320
|
[K in keyof B]: B[K] extends JsonSchemaAnyBuilder<any, infer O, any> ? O : never
|