Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tson-schema

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tson-schema - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

2

package.json
{
"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 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc