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.2.0 to 0.2.1

2

dist/common.d.ts

@@ -5,3 +5,3 @@ export interface TypedSchema<T> {

}
export declare type JSONSchema = boolean | number | object | string;
export declare type JSONSchema = object;
export interface BaseSchemaDefinition {

@@ -8,0 +8,0 @@ /**

{
"name": "tson-schema",
"version": "0.2.0",
"version": "0.2.1",
"description": "A TypeScript API to create JSON-Schemas and TypeScript types",

@@ -23,13 +23,15 @@ "files": [

"devDependencies": {
"@types/ajv": "^1.0.0",
"@types/tape": "^4.2.33",
"nodemon": "^1.18.9",
"ajv": "^6.10.0",
"nodemon": "^1.18.10",
"prettier": "^1.16.4",
"tap-spec": "^5.0.0",
"tape": "^4.9.2",
"ts-node": "^8.0.2",
"tslint": "^5.12.1",
"tape": "^4.10.1",
"ts-node": "^8.0.3",
"tslint": "^5.13.1",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"typescript": "^3.3.1"
"typescript": "^3.3.3333"
}
}

@@ -10,3 +10,2 @@ # tson-schema

- `$ref`
- JSON-Schema `anyOf`/`oneOf`
- JSON-Schema conditional schemas (`if`/`else`)

@@ -68,8 +67,17 @@ - Limited TypeScript support for:

*/
const enumSchema = t.enum({
enum: ['A', 2, 'C', 4]
})
const enumSchema = t.enum(['A', 2, 'C', 4])
enumSchema.getSchema() // { enum: ['A', 2, 'C', 4] }
enumSchema.type // 'A' | 2 | 'C' | 4
/**
* anyOf
*/
const anyOfSchema = t.anyOf([
s.const('A'),
s.integer()
])
enumSchema.getSchema() // { anyOf: [{ const: 'A' }, { type: 'integer' }] }
enumSchema.type // 'A' | number
```
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