Socket
Socket
Sign inDemoInstall

arktype

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arktype - npm Package Compare versions

Comparing version 1.0.18-alpha to 1.0.19-alpha

4

dist/types/parse/ast/intersection.d.ts
import type { DisjointsByPath } from "../../nodes/compose.js";
import type { MappedKeys } from "../../nodes/rules/props.js";
import type { asConst, Dict, error, evaluate, extractValues, isAny, List, stringKeyOf, tryCatch } from "../../utils/generics.js";
import type { asConst, Dict, error, evaluate, extractValues, isAny, List, tryCatch } from "../../utils/generics.js";
import type { Path, pathToString } from "../../utils/paths.js";

@@ -8,3 +8,3 @@ import type { ParsedMorph } from "./morph.js";

type inferIntersectionRecurse<l, r, path extends string[]> = path["length"] extends 10 ? l & r : l extends never ? never : r extends never ? never : l & r extends never ? error<writeImplicitNeverMessage<path, "Intersection">> : isAny<l | r> extends true ? any : l extends ParsedMorph<infer lIn, infer lOut> ? r extends ParsedMorph ? error<writeImplicitNeverMessage<path, "Intersection", "of morphs">> : (In: evaluate<lIn & r>) => lOut : r extends ParsedMorph<infer rIn, infer rOut> ? (In: evaluate<rIn & l>) => rOut : [l, r] extends [Dict, Dict] ? bubblePropErrors<evaluate<{
[k in stringKeyOf<l>]: k extends keyof r ? inferIntersectionRecurse<l[k], r[k], [...path, k]> : l[k];
[k in keyof l as k extends string ? k : never]: k extends string ? k extends keyof r ? inferIntersectionRecurse<l[k], r[k], [...path, k]> : l[k] : never;
} & Omit<r, keyof l>>> : l extends List ? r extends List ? inferArrayIntersection<l, r, path> : l & r : l & r;

@@ -11,0 +11,0 @@ type inferArrayIntersection<l extends List, r extends List, path extends string[]> = isTuple<l> extends true ? {

import type { asIn } from "../../scopes/type.js";
import type { domainOf } from "../../utils/domains.js";
import type { equals, error, extractValues, isAny, requiredKeyOf } from "../../utils/generics.js";
import type { equals, error, extractValues, isAny, optionalKeyOf, requiredKeyOf } from "../../utils/generics.js";
import type { objectKindOf } from "../../utils/objectKinds.js";

@@ -8,3 +8,8 @@ export type inferUnion<l, r> = isAny<l | r> extends true ? any : [l] extends [never] ? r : [r] extends [never] ? l : [asIn<l>, asIn<r>] extends [infer lIn, infer rIn] ? [equals<l, lIn>, equals<r, rIn>] extends [true, true] ? l | r : discriminatable<lIn, rIn> extends true ? l | r : error<undiscriminatableMorphUnionMessage> : never;

type discriminatableRecurse<l, r, path extends string[]> = path["length"] extends 10 ? never : l & r extends never ? path : domainOf<l> & domainOf<r> extends never ? path : objectKindOf<l> & objectKindOf<r> extends never ? path : [objectKindOf<l>, objectKindOf<r>] extends ["Object", "Object"] ? extractValues<{
[k in requiredKeyOf<l>]: k extends requiredKeyOf<r> ? discriminatableRecurse<l[k], r[k], [...path, k & string]> : never;
[k in keyof l as k extends optionalKeyOf<l> ? never : k]: k extends requiredKeyOf<r> ? discriminatableRecurse<l[k], r[k], [
...path,
k & string
]> & {
_: l;
} : never;
}, string[]> : never;

@@ -11,0 +16,0 @@ export declare const writeUndiscriminatableMorphUnionMessage: <path extends string>(path: path) => string;

@@ -8,4 +8,6 @@ import type { ResolvedNode } from "../nodes/node.js";

export type inferRecord<def extends Dict, $> = evaluate<{
[requiredKeyName in requiredKeyOf<def>]: inferDefinition<def[withPossiblePreviousEscapeCharacter<requiredKeyName>], $>;
[k in keyof def as k extends requiredKeyOf<def> ? k : never]: inferDefinition<def[withPossiblePreviousEscapeCharacter<k>], $>;
} & {
[k in Exclude<requiredKeyOf<def>, keyof def>]: inferDefinition<def[withPossiblePreviousEscapeCharacter<k>], $>;
} & {
[optionalKeyName in optionalKeyOf<def>]?: inferDefinition<def[`${optionalKeyName}?`], $>;

@@ -12,0 +14,0 @@ }>;

{
"name": "arktype",
"description": "TypeScript's 1:1 validator, optimized from editor to runtime",
"version": "1.0.18-alpha",
"version": "1.0.19-alpha",
"license": "MIT",

@@ -6,0 +6,0 @@ "author": {

@@ -264,4 +264,4 @@ <h1 align="center">ArkType <sub><sup>TypeScript's 1:1 validator</sup></sub></h1>

| [tmm](https://github.com/tmm) | [xrexy](https://github.com/xrexy) | [thomasballinger](https://github.com/thomasballinger) | [codeandcats](https://github.com/codeandcats) | [jacksteamdev](https://github.com/jacksteamdev) |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| <img height="64px" src="https://avatars.githubusercontent.com/u/6759464"> | <img height="64px" src="https://avatars.githubusercontent.com/u/71969236"> | <img height="64px" src="https://avatars.githubusercontent.com/u/458879"> | <img height="64px" src="https://avatars.githubusercontent.com/u/6035934"> | <img height="64px" src="https://avatars.githubusercontent.com/u/23390212"> |
| [tmm](https://github.com/tmm) | [xrexy](https://github.com/xrexy) | [thomasballinger](https://github.com/thomasballinger) | [codeandcats](https://github.com/codeandcats) | [jacksteamdev](https://github.com/jacksteamdev) | [neodon](https://github.com/neodon) |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| <img height="64px" src="https://avatars.githubusercontent.com/u/6759464"> | <img height="64px" src="https://avatars.githubusercontent.com/u/71969236"> | <img height="64px" src="https://avatars.githubusercontent.com/u/458879"> | <img height="64px" src="https://avatars.githubusercontent.com/u/6035934"> | <img height="64px" src="https://avatars.githubusercontent.com/u/23390212"> | <img height="64px" src="https://avatars.githubusercontent.com/u/82944"> |

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