New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json-schema-ts

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-ts - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

.vscode/settings.json

4

package.json
{
"name": "json-schema-ts",
"version": "1.1.2",
"version": "1.1.3",
"description": "JSON schema types for TypeScript",

@@ -12,4 +12,4 @@ "main": "index.js",

"devDependencies": {
"typescript": "^3.2.4"
"typescript": "^3.4.5"
}
}

@@ -92,11 +92,25 @@ "use strict";

}
// FIXME: s.object() does not work
// {
// const the_object = s.object({
// });
// type T = t.TSType<typeof the_object>;
// meta.equal<T, {}>(true);
// // meta.equal<T, {[key: string]: number}>(false);
// meta.equal<T, any[]>(false);
// meta.equal<T, string>(false);
// ((_x: T) => {})({});
// }
{
var the_object = index_1.s.object({
'default': {},
'properties': {
'hello': index_1.s.number(),
}
});
meta.equal(true);
// meta.equal<T, {[key: string]: number}>(false);
meta.equal(false);
meta.equal(false);
(function (_x) { })({});
meta.equal(false);
(function (_x) { })({ 'hello': 1 });
}

@@ -111,3 +125,6 @@ {

{
var items = index_1.s.items(index_1.s.string(), index_1.s.number(), index_1.s.integer(), index_1.s.boolean(), index_1.s.object(), index_1.s.object({
var items = index_1.s.items(index_1.s.string(), index_1.s.number(), index_1.s.integer(), index_1.s.boolean(),
// FIXME
// s.object(),
index_1.s.object({
'properties': {

@@ -123,3 +140,3 @@ 'hello': index_1.s.string()

true,
{},
// {},
{ 'hello': 'haha' },

@@ -158,6 +175,8 @@ ['asas', 1, true, false, {}],

'boolean': index_1.s.boolean(),
'object': index_1.s.object(),
// FIXME: s.object() does not work
// 'object': s.object(),
'nested_object': index_1.s.object({
'properties': {
'array': index_1.s.array(),
// FIXME: s.array() does not work
'array': index_1.s.array({ 'items': true }),
}

@@ -177,5 +196,5 @@ }),

'boolean': true,
'object': {},
// 'object': {},
'nested_object': {
'array': []
'array': [],
},

@@ -182,0 +201,0 @@ 'array': [],

@@ -120,12 +120,27 @@ import {t, s} from './index';

// FIXME: s.object() does not work
// {
// const the_object = s.object({
// });
// type T = t.TSType<typeof the_object>;
// meta.equal<T, {}>(true);
// // meta.equal<T, {[key: string]: number}>(false);
// meta.equal<T, any[]>(false);
// meta.equal<T, string>(false);
// ((_x: T) => {})({});
// }
{
const the_object = s.object({
'default': {},
'properties': {
'hello': s.number(),
}
});
type T = t.TSType<typeof the_object>;
meta.equal<T, {}>(true);
// meta.equal<T, {[key: string]: number}>(false);
meta.equal<T, {hello: number}>(true);
meta.equal<T, {[key: string]: number}>(false);
meta.equal<T, any[]>(false);
meta.equal<T, string>(false);
((_x: T) => {})({});
((_x: T) => {})({'hello': 1});
}

@@ -148,3 +163,4 @@

s.boolean(),
s.object(),
// FIXME
// s.object(),
s.object({

@@ -167,3 +183,3 @@ 'properties': {

true,
{},
// {},
{'hello': 'haha'},

@@ -210,6 +226,8 @@ ['asas', 1, true, false, {}],

'boolean': s.boolean(),
'object': s.object(),
// FIXME: s.object() does not work
// 'object': s.object(),
'nested_object': s.object({
'properties': {
'array': s.array(),
// FIXME: s.array() does not work
'array': s.array({'items': true}),
}

@@ -231,5 +249,5 @@ }),

'boolean': true,
'object': {},
// 'object': {},
'nested_object': {
'array': []
'array': [],
},

@@ -236,0 +254,0 @@ 'array': [],

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