Skip to content

Commit c7bf889

Browse files
authoredDec 14, 2021
fix prettier, add logo (#1848)
1 parent 8d20f6b commit c7bf889

File tree

5 files changed

+34
-13
lines changed

5 files changed

+34
-13
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Supports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https://
2121

2222
[<img src="https://ajv.js.org/img/microsoft.png" width="31%" alt="Microsoft">](https://opensource.microsoft.com)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="31%">](https://opencollective.com/ajv)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="31%">](https://opencollective.com/ajv)
2323

24-
[<img src="https://ajv.js.org/img/retool.svg" width="22.5%" alt="Retool">](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/tidelift.svg" width="22.5%" alt="Tidelift">](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="22.5%">](https://opencollective.com/ajv)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="22.5%">](https://opencollective.com/ajv)
24+
[<img src="https://ajv.js.org/img/retool.svg" width="22.5%" alt="Retool">](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/tidelift.svg" width="22.5%" alt="Tidelift">](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="22.5%" alt="SimpleX">](https://github.com/simplex-chat/simplex-chat)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="22.5%">](https://opencollective.com/ajv)
2525

2626
## Contributing
2727

‎docs/.vuepress/public/img/simplex.svg

+25
Loading

‎docs/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Use JSON Type Definition or JSON Schema
5353

5454
<Sponsors level="bronze">
5555

56-
[![retool](/img/retool.svg)](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)
57-
[![tidelift](/img/tidelift.svg)](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)
58-
[![reserved](/img/reserved.svg)](https://opencollective.com/ajv)
56+
[![Retool](/img/retool.svg)](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)
57+
[![Tidelift](/img/tidelift.svg)](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)
58+
[![SimpleX](/img/simplex.svg)](https://github.com/simplex-chat/simplex-chat)
5959
[![reserved](/img/reserved.svg)](https://opencollective.com/ajv)
6060

6161
</Sponsors>

‎lib/types/json-schema.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@ type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (
113113
dependentSchemas?: {[K in keyof T]?: UncheckedPartialSchema<T>}
114114
minProperties?: number
115115
maxProperties?: number
116-
} & (// "required" type does not guarantee that all required properties
117-
// are listed it only asserts that optional cannot be listed.
118-
// "required" is not necessary if it's a non-partial type with no required keys
119-
IsPartial extends true
116+
} & (IsPartial extends true // "required" is not necessary if it's a non-partial type with no required keys // are listed it only asserts that optional cannot be listed. // "required" type does not guarantee that all required properties
120117
? {required: Readonly<(keyof T)[]>}
121118
: [UncheckedRequiredMembers<T>] extends [never]
122119
? {required?: Readonly<UncheckedRequiredMembers<T>[]>}

‎lib/types/jtd-schema.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string,
117117
: never))
118118
// empty - empty schemas also treat nullable differently in that it's now fully ignored
119119
| (unknown extends T ? {nullable?: boolean} : never)
120-
// all other types
121-
| ((// numbers - only accepts the type number
122-
true extends NullTypeEquality<T, number>
120+
// all other types // numbers - only accepts the type number
121+
| ((true extends NullTypeEquality<T, number>
123122
? {type: NumberType}
124123
: // booleans - accepts the type boolean
125124
true extends NullTypeEquality<T, boolean>
@@ -198,8 +197,8 @@ export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string,
198197
}
199198

200199
type JTDDataDef<S, D extends Record<string, unknown>> =
201-
| (// ref
202-
S extends {ref: string}
200+
| // ref
201+
(S extends {ref: string}
203202
? D extends {[K in S["ref"]]: infer V}
204203
? JTDDataDef<V, D>
205204
: never

0 commit comments

Comments
 (0)
Please sign in to comment.