Skip to content

Commit

Permalink
v2.7.0-beta.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAribart committed Feb 22, 2023
1 parent f4a9035 commit 1963499
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions builds/deno/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,21 @@ declare type FromSchemaDefaultOptions = {

declare type And<A, B> = A extends true ? B extends true ? true : false : false;

declare type Compute<A> = A extends Promise<infer T> ? Promise<Compute<T>> : A extends (...args: infer P) => infer R ? (...args: Compute<P>) => Compute<R> : A extends Set<infer V> ? Set<Compute<V>> : A extends object ? {
[key in keyof A]: Compute<A[key]>;
} : A;
declare type DoesExtend<A, B> = [A] extends [B] ? true : false;

declare type DoesExtend<A, B> = A extends B ? true : false;
declare type If<B extends boolean, T, E = never> = B extends true ? T : E;

declare type Key = string | number | symbol;

declare type Compute<A, Seen = never> = A extends Function | Error | Date | {
readonly [Symbol.toStringTag]: string;
} | RegExp | Generator ? A : If<DoesExtend<Seen, A>, A, A extends Array<unknown> ? A extends Array<Record<Key, unknown>> ? Array<{
[K in keyof A[number]]: Compute<A[number][K], A | Seen>;
} & unknown> : A : A extends ReadonlyArray<unknown> ? A extends ReadonlyArray<Record<string | number | symbol, unknown>> ? ReadonlyArray<{
[K in keyof A[number]]: Compute<A[number][K], A | Seen>;
} & unknown> : A : {
[K in keyof A]: Compute<A[K], A | Seen>;
} & unknown>;

declare type DeepGet<O, P extends string[], D = undefined> = P extends [
infer H,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-schema-to-ts",
"version": "2.7.0-beta.0",
"version": "2.7.0-beta.2",
"description": "Infer typescript types from your JSON schemas!",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand Down

0 comments on commit 1963499

Please sign in to comment.