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

as-typed

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-typed - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

.github/dependabot.yml

21

index.d.ts

@@ -229,2 +229,6 @@ declare namespace AsTypedInternal {

? number
: SchemaType extends TupleSchema<infer TupleType, infer Additional>
? Additional extends null
? AsTypedTupleSchema<TupleType>
: AsTypedTupleSchemaWithAdditional<TupleType, Additional>
: SchemaType extends Not<infer T>

@@ -256,6 +260,2 @@ ? ResolveNot<T>

// TODO
type ResolveOneOf<InnerSchema> = InnerSchema;
// High order resolution changes the schema before resolving it to typed

@@ -268,3 +268,3 @@

: SchemaToResolve extends OneOf<infer Inner>
? ResolveOneOf<Inner>
? Inner
: SchemaToResolve extends AllOf<infer Inner>

@@ -276,10 +276,5 @@ ? UnionToIntersection<Inner>

type ResolveRecursive<SchemaType> = SchemaType extends TupleSchema<
infer TupleType,
infer Additional
>
? Additional extends null
? AsTypedTupleSchema<TupleType>
: AsTypedTupleSchemaWithAdditional<TupleType, Additional>
: ResolveRecursiveInternal<ResolveHighOrder<SchemaType>>;
type ResolveRecursive<SchemaType> = ResolveRecursiveInternal<
ResolveHighOrder<SchemaType>
>;

@@ -286,0 +281,0 @@ type MapPropsToRefs<

{
"name": "as-typed",
"version": "1.1.1",
"version": "1.1.2",
"description": "Static TypeScript types from a literal JSONSchema type",
"types": "index.d.ts",
"scripts": {
"start": "ts-node src/main.ts",
"test": "$(node spec/setup.js) && jest -w10",
"test": "tsc -noEmit",
"eslint:fix": "eslint --fix '*.ts'",
"eslint:check": "eslint '*.ts'",
"prettier:fix": "prettier --write '*.{t,j}s'",
"prettier:check": "prettier --check '*.{t,j}s'",
"build": "tsc"
"prettier:check": "prettier --check '*.{t,j}s'"
},
"keywords": [],
"keywords": [
"typescript",
"jsonschema",
"json",
"schema"
],
"author": "Guilherme Bernal <guilherme@cubos.io>",

@@ -17,0 +20,0 @@ "license": "MIT",

@@ -131,3 +131,27 @@ import { AsTyped } from "./index";

_ as AsTyped<{
oneOf: [{ type: "string" }, { type: "array"; items: { type: "string" } }];
}>,
_ as string | string[]
);
assert(
_ as AsTyped<{
oneOf: [{ type: "string" }, { type: "array"; items: [] }];
}>,
_ as string | []
);
assert(
_ as AsTyped<{
oneOf: [
{ type: "array"; items: [{ type: "string" }] },
{ type: "array"; items: [] }
];
}>,
_ as [string] | []
);
assert(
_ as AsTyped<{
oneOf: [
{ type: "string" },

@@ -134,0 +158,0 @@ { type: "object"; properties: { a: { type: "number" } } }

Sorry, the diff of this file is not supported yet

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