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

@tanstack/form-core

Package Overview
Dependencies
Maintainers
2
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/form-core - npm Package Compare versions

Comparing version 0.19.1 to 0.19.2

11

dist/esm/util-types.d.ts

@@ -33,12 +33,3 @@ export type RequiredByKey<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;

*/
export type DeepValue<TValue, TAccessor, TDepth extends any[] = []> = TDepth['length'] extends 3 ? never : TValue extends ReadonlyArray<any> ? TAccessor extends `[${infer TBrackets}].${infer TAfter}` ? DeepValue<DeepValue<TValue, TBrackets, [...TDepth, any]>, TAfter, [
...TDepth,
any
]> : TAccessor extends `[${infer TBrackets}]` ? DeepValue<TValue, TBrackets, [...TDepth, any]> : TAccessor extends keyof TValue ? TValue[TAccessor] : TValue[TAccessor & number] : TValue extends Record<string | number, any> ? TAccessor extends `${infer TBefore}[${infer TEverythingElse}` ? DeepValue<DeepValue<TValue, TBefore, [...TDepth, any]>, `[${TEverythingElse}`, [
...TDepth,
any
]> : TAccessor extends `[${infer TBrackets}]` ? DeepValue<TValue, TBrackets, [...TDepth, any]> : TAccessor extends `${infer TBefore}.${infer TAfter}` ? DeepValue<DeepValue<TValue, TBefore, [...TDepth, any]>, TAfter, [
...TDepth,
any
]> : TAccessor extends string ? TValue[TAccessor] : never : never;
export type DeepValue<TValue, TAccessor> = unknown extends TValue ? TValue : TValue extends ReadonlyArray<any> ? TAccessor extends `[${infer TBrackets}].${infer TAfter}` ? DeepValue<DeepValue<TValue, TBrackets>, TAfter> : TAccessor extends `[${infer TBrackets}]` ? DeepValue<TValue, TBrackets> : TAccessor extends keyof TValue ? TValue[TAccessor] : TValue[TAccessor & number] : TValue extends Record<string | number, any> ? TAccessor extends `${infer TBefore}[${infer TEverythingElse}` ? DeepValue<DeepValue<TValue, TBefore>, `[${TEverythingElse}`> : TAccessor extends `[${infer TBrackets}]` ? DeepValue<TValue, TBrackets> : TAccessor extends `${infer TBefore}.${infer TAfter}` ? DeepValue<DeepValue<TValue, TBefore>, TAfter> : TAccessor extends string ? TValue[TAccessor] : never : never;
export {};

2

package.json
{
"name": "@tanstack/form-core",
"version": "0.19.1",
"version": "0.19.2",
"description": "Powerful, type-safe, framework agnostic forms.",

@@ -5,0 +5,0 @@ "author": "tannerlinsley",

@@ -138,1 +138,15 @@ import { assertType } from 'vitest'

assertType<string>(0 as never as FormDefinitionValue)
type DoubleDeepArray = DeepValue<
{
people: {
parents: {
name: string
age: number
}[]
}[]
},
`people[${0}].parents[${0}].name`
>
assertType<string>(0 as never as DoubleDeepArray)

@@ -99,8 +99,6 @@ export type RequiredByKey<T, K extends keyof T> = Omit<T, K> &

TAccessor,
// (Optional) An array representing the current depth of recursion
TDepth extends any[] = [],
> =
// Limit the depth of recursion to 3 levels
TDepth['length'] extends 3
? never
// If TValue is any it will recurse forever, this terminates the recursion
unknown extends TValue
? TValue
: // Check if we're looking for the property in an array

@@ -113,9 +111,5 @@ TValue extends ReadonlyArray<any>

*/
DeepValue<
DeepValue<TValue, TBrackets, [...TDepth, any]>,
TAfter,
[...TDepth, any]
>
DeepValue<DeepValue<TValue, TBrackets>, TAfter>
: TAccessor extends `[${infer TBrackets}]`
? DeepValue<TValue, TBrackets, [...TDepth, any]>
? DeepValue<TValue, TBrackets>
: TAccessor extends keyof TValue

@@ -127,15 +121,7 @@ ? TValue[TAccessor]

? TAccessor extends `${infer TBefore}[${infer TEverythingElse}`
? DeepValue<
DeepValue<TValue, TBefore, [...TDepth, any]>,
`[${TEverythingElse}`,
[...TDepth, any]
>
? DeepValue<DeepValue<TValue, TBefore>, `[${TEverythingElse}`>
: TAccessor extends `[${infer TBrackets}]`
? DeepValue<TValue, TBrackets, [...TDepth, any]>
? DeepValue<TValue, TBrackets>
: TAccessor extends `${infer TBefore}.${infer TAfter}`
? DeepValue<
DeepValue<TValue, TBefore, [...TDepth, any]>,
TAfter,
[...TDepth, any]
>
? DeepValue<DeepValue<TValue, TBefore>, TAfter>
: TAccessor extends string

@@ -142,0 +128,0 @@ ? TValue[TAccessor]

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