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

json-schema-to-ts

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-to-ts - npm Package Compare versions

Comparing version 2.7.0-beta.1 to 2.7.0-beta.2

lib/cjs/type-utils/if.js

15

lib/types/type-utils/compute.d.ts

@@ -1,3 +0,12 @@

export declare type Compute<A> = A extends Promise<infer T> ? Promise<Compute<T>> : A extends (...args: infer P) => infer R ? (...args: Compute<P>) => Compute<R> : A extends Set<infer V> ? Set<Compute<V>> : A extends object ? {
[key in keyof A]: Compute<A[key]>;
} : A;
import type { DoesExtend } from "./extends";
import type { If } from "./if";
import type { Key } from "./key";
export declare type Compute<A, Seen = never> = A extends Function | Error | Date | {
readonly [Symbol.toStringTag]: string;
} | RegExp | Generator ? A : If<DoesExtend<Seen, A>, A, A extends Array<unknown> ? A extends Array<Record<Key, unknown>> ? Array<{
[K in keyof A[number]]: Compute<A[number][K], A | Seen>;
} & unknown> : A : A extends ReadonlyArray<unknown> ? A extends ReadonlyArray<Record<string | number | symbol, unknown>> ? ReadonlyArray<{
[K in keyof A[number]]: Compute<A[number][K], A | Seen>;
} & unknown> : A : {
[K in keyof A]: Compute<A[K], A | Seen>;
} & unknown>;

2

lib/types/type-utils/extends.d.ts

@@ -1,1 +0,1 @@

export declare type DoesExtend<A, B> = A extends B ? true : false;
export declare type DoesExtend<A, B> = [A] extends [B] ? true : false;

@@ -5,2 +5,4 @@ export type { And } from "./and";

export type { DeepGet } from "./get";
export type { If } from "./if";
export type { Key } from "./key";
export type { Join } from "./join";

@@ -7,0 +9,0 @@ export type { Narrow } from "./narrow";

{
"name": "json-schema-to-ts",
"version": "2.7.0-beta.1",
"version": "2.7.0-beta.2",
"description": "Infer typescript types from your JSON schemas!",

@@ -25,3 +25,3 @@ "main": "lib/cjs/index.js",

"@types/json-schema": "^7.0.9",
"ts-algebra": "1.2.0-beta.0"
"ts-algebra": "^1.1.1"
},

@@ -28,0 +28,0 @@ "devDependencies": {

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