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

@pothos/core

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pothos/core - npm Package Compare versions

Comparing version 3.33.0 to 3.33.1

6

CHANGELOG.md
# Change Log
## 3.33.1
### Patch Changes
- 6f155d82: Improve normalization of input types so that objects with functions are not normalized
## 3.33.0

@@ -4,0 +10,0 @@

11

dts/types/utils.d.ts

@@ -32,6 +32,11 @@ export type MaybePromise<T> = Promise<T> | T;

};
export type RecursivelyNormalizeNullableFields<T> = T extends null | undefined ? null | undefined : T extends (infer L)[] ? RecursivelyNormalizeNullableFields<L>[] : T extends (...args: any[]) => unknown ? T : keyof T extends string ? T extends object ? Normalize<{
[K in OptionalKeys<T>]?: K extends string ? RecursivelyNormalizeNullableFields<NonNullable<T[K]>> | null | undefined : T[K];
export type IsSimpleRecord<T> = ([
T
] extends [Record<string, any>] ? keyof T extends infer K ? K extends string ? T[K] extends (...args: any[]) => unknown ? [
1
] extends [T[K]] ? never : false : never : never : false : false) extends never ? true : false;
export type RecursivelyNormalizeNullableFields<T> = T extends null | undefined ? null | undefined : T extends (infer L)[] ? RecursivelyNormalizeNullableFields<L>[] : T extends (...args: any[]) => unknown ? T : keyof T extends string ? IsSimpleRecord<T> extends true ? Normalize<{
[K in OptionalKeys<T & object>]?: K extends string ? RecursivelyNormalizeNullableFields<NonNullable<T[K]>> | null | undefined : T[K];
} & {
[K in RequiredKeys<T>]: RecursivelyNormalizeNullableFields<NonNullable<T[K]>>;
[K in RequiredKeys<T & object>]: RecursivelyNormalizeNullableFields<NonNullable<T[K]>>;
}> : T : T;

@@ -38,0 +43,0 @@ export type RemoveNeverKeys<T extends {}> = {

@@ -32,6 +32,15 @@ export type MaybePromise<T> = Promise<T> | T;

};
export type RecursivelyNormalizeNullableFields<T> = T extends null | undefined ? null | undefined : T extends (infer L)[] ? RecursivelyNormalizeNullableFields<L>[] : T extends (...args: any[]) => unknown ? T : keyof T extends string ? T extends object ? Normalize<{
[K in OptionalKeys<T>]?: K extends string ? RecursivelyNormalizeNullableFields<NonNullable<T[K]>> | null | undefined : T[K];
export type IsSimpleRecord<T> = ([
T
] extends [
Record<string, any>
] ? keyof T extends infer K ? K extends string ? T[K] extends (...args: any[]) => unknown ? [
1
] extends [
T[K]
] ? never : false : never : never : false : false) extends never ? true : false;
export type RecursivelyNormalizeNullableFields<T> = T extends null | undefined ? null | undefined : T extends (infer L)[] ? RecursivelyNormalizeNullableFields<L>[] : T extends (...args: any[]) => unknown ? T : keyof T extends string ? IsSimpleRecord<T> extends true ? Normalize<{
[K in OptionalKeys<T & object>]?: K extends string ? RecursivelyNormalizeNullableFields<NonNullable<T[K]>> | null | undefined : T[K];
} & {
[K in RequiredKeys<T>]: RecursivelyNormalizeNullableFields<NonNullable<T[K]>>;
[K in RequiredKeys<T & object>]: RecursivelyNormalizeNullableFields<NonNullable<T[K]>>;
}> : T : T;

@@ -38,0 +47,0 @@ export type RemoveNeverKeys<T extends {}> = {

{
"name": "@pothos/core",
"version": "3.33.0",
"version": "3.33.1",
"description": "Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -49,2 +49,20 @@ export type MaybePromise<T> = Promise<T> | T;

// Check if T is a Record of string keys who's values are not functions
export type IsSimpleRecord<T> = (
[T] extends [Record<string, any>] // eslint-disable-line @typescript-eslint/no-explicit-any
? keyof T extends infer K
? K extends string
? T[K] extends (...args: any[]) => unknown
? // check if T[K] is any (T[K] is distributed, so it can't also be a number unless its any)
[1] extends [T[K]]
? never
: false
: never
: never
: false
: false
) extends never
? true
: false;
export type RecursivelyNormalizeNullableFields<T> = T extends null | undefined

@@ -57,10 +75,10 @@ ? null | undefined

: keyof T extends string
? T extends object
? IsSimpleRecord<T> extends true
? Normalize<
{
[K in OptionalKeys<T>]?: K extends string
[K in OptionalKeys<T & object>]?: K extends string
? RecursivelyNormalizeNullableFields<NonNullable<T[K]>> | null | undefined
: T[K];
} & {
[K in RequiredKeys<T>]: RecursivelyNormalizeNullableFields<NonNullable<T[K]>>;
[K in RequiredKeys<T & object>]: RecursivelyNormalizeNullableFields<NonNullable<T[K]>>;
}

@@ -67,0 +85,0 @@ >

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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