tson-schema
Advanced tools
Comparing version 0.0.2 to 0.1.0
{ | ||
"name": "tson-schema", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "A TypeScript API to create JSON-Schemas and TypeScript types", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -11,2 +11,3 @@ # tson-schema | ||
- `$ref` | ||
- JSON-Schema conditional schemas (`if`/`else`) | ||
- Limited TypeScript support for big tuples and objects with lots of required properties | ||
@@ -29,3 +30,3 @@ | ||
```ts | ||
import * as s from 'tson-schema' | ||
import * as t from 'tson-schema' | ||
@@ -35,4 +36,4 @@ /** | ||
*/ | ||
const numberArraySchema = s.Array({ | ||
items: s.Number({ | ||
const numberArraySchema = t.array({ | ||
items: t.number({ | ||
minimum: 1 | ||
@@ -50,7 +51,7 @@ }), | ||
*/ | ||
const objectSchema = s.Obj({ | ||
const objectSchema = t.object({ | ||
properties: { | ||
req: s.String(), | ||
opt: s.Tuple({ | ||
items: [s.Integer()] | ||
req: t.string(), | ||
opt: t.tuple({ | ||
items: [t.integer()] | ||
}) | ||
@@ -57,0 +58,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61
2501
2
0
2