teyit 1.0.3 → 1.0.5

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.
package/README.md CHANGED
@@ -163,7 +163,7 @@ Validate the properties with your Teyit schema.
163
163
  > | `schema` | [Schema] | | Teyit schema. |
164
164
  > | `properties` | [AnyObject] | | Properties to be validate. |
165
165
  >
166
- > returns [Promise]<[InferSchema<Schema>]>
166
+ > returns [Promise]<[InferSchema]\<Schema\>>
167
167
  >
168
168
  > Example:
169
169
  >
package/dist/main.d.mts CHANGED
@@ -187,7 +187,8 @@ type InferSchemaSingle<Schema> = Prettify<{
187
187
  } & {
188
188
  [Key in OptionalKeys<Schema>]?: InferType<Schema[Key]>;
189
189
  }>;
190
- type InferSchema<Schema> = Schema extends readonly unknown[] ? InferSchemaSingle<Schema[number]> : InferSchemaSingle<Schema>;
190
+ type DistributeSchema<Schema> = Schema extends unknown ? InferSchemaSingle<Schema> : never;
191
+ type InferSchema<Schema> = Schema extends readonly unknown[] ? DistributeSchema<Schema[number]> : InferSchemaSingle<Schema>;
191
192
 
192
193
  type UnknownObject = Record<string, unknown>;
193
194
 
package/dist/main.d.ts CHANGED
@@ -187,7 +187,8 @@ type InferSchemaSingle<Schema> = Prettify<{
187
187
  } & {
188
188
  [Key in OptionalKeys<Schema>]?: InferType<Schema[Key]>;
189
189
  }>;
190
- type InferSchema<Schema> = Schema extends readonly unknown[] ? InferSchemaSingle<Schema[number]> : InferSchemaSingle<Schema>;
190
+ type DistributeSchema<Schema> = Schema extends unknown ? InferSchemaSingle<Schema> : never;
191
+ type InferSchema<Schema> = Schema extends readonly unknown[] ? DistributeSchema<Schema[number]> : InferSchemaSingle<Schema>;
191
192
 
192
193
  type UnknownObject = Record<string, unknown>;
193
194
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teyit",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Portable and simple schemas for property validation.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/keift/teyit",
@@ -23,7 +23,7 @@
23
23
  "slugify": "^1.6.6",
24
24
  "sort-keys": "^6.0.0",
25
25
  "traverse": "^0.6.11",
26
- "typof": "^1.0.15"
26
+ "typof": "^1.0.16"
27
27
  },
28
28
  "devDependencies": {
29
29
  "prettier": "latest",