@tanstack/form-core
Advanced tools
Comparing version 0.21.0 to 0.21.1
@@ -27,5 +27,5 @@ type Nullable<T> = T | null; | ||
type PrefixObjectAccessor<T extends object, TDepth extends any[]> = { | ||
[K in keyof T]: K extends string | number ? PrefixFromDepth<K, TDepth> | `${PrefixFromDepth<K, TDepth>}${DeepKeys<T[K], [TDepth]>}` : never; | ||
[K in keyof T]-?: K extends string | number ? PrefixFromDepth<K, TDepth> | `${PrefixFromDepth<K, TDepth>}${DeepKeys<T[K], [TDepth]>}` : never; | ||
}[keyof T]; | ||
export type DeepKeys<T, TDepth extends any[] = []> = TDepth['length'] extends 5 ? never : unknown extends T ? PrefixFromDepth<string, TDepth> : object extends T ? PrefixFromDepth<string, TDepth> : T extends readonly any[] & IsTuple<T> ? PrefixTupleAccessor<T, AllowedIndexes<T>, TDepth> : T extends any[] ? PrefixArrayAccessor<T, [...TDepth, any]> : T extends Date ? never : T extends object ? PrefixObjectAccessor<T, TDepth> : T extends string | number | boolean | bigint ? '' : never; | ||
export type DeepKeys<T, TDepth extends any[] = []> = TDepth['length'] extends 5 ? never : unknown extends T ? PrefixFromDepth<string, TDepth> : T extends readonly any[] & IsTuple<T> ? PrefixTupleAccessor<T, AllowedIndexes<T>, TDepth> : T extends any[] ? PrefixArrayAccessor<T, [...TDepth, any]> : T extends Date ? never : T extends object ? PrefixObjectAccessor<T, TDepth> : T extends string | number | boolean | bigint ? '' : never; | ||
type PrefixFromDepth<T extends string | number, TDepth extends any[]> = TDepth['length'] extends 0 ? T : `.${T}`; | ||
@@ -32,0 +32,0 @@ /** |
{ | ||
"name": "@tanstack/form-core", | ||
"version": "0.21.0", | ||
"version": "0.21.1", | ||
"description": "Powerful, type-safe, framework agnostic forms.", | ||
@@ -36,5 +36,5 @@ "author": "tannerlinsley", | ||
"dependencies": { | ||
"@tanstack/store": "^0.3.1" | ||
"@tanstack/store": "^0.4.1" | ||
}, | ||
"scripts": {} | ||
} |
@@ -45,2 +45,14 @@ import { assertType } from 'vitest' | ||
/** | ||
* Properly handles deep partial object nesting like so: | ||
*/ | ||
type NestedPartialSupport = DeepKeys<{ meta?: { mainUser?: User } }> | ||
assertType< | ||
| 'meta' | ||
| 'meta.mainUser' | ||
| 'meta.mainUser.name' | ||
| 'meta.mainUser.id' | ||
| 'meta.mainUser.age' | ||
>(0 as never as NestedPartialSupport) | ||
/** | ||
* Properly handles `object` edgecase nesting like so: | ||
@@ -47,0 +59,0 @@ */ |
@@ -63,3 +63,3 @@ type Nullable<T> = T | null | ||
type PrefixObjectAccessor<T extends object, TDepth extends any[]> = { | ||
[K in keyof T]: K extends string | number | ||
[K in keyof T]-?: K extends string | number | ||
? | ||
@@ -75,15 +75,13 @@ | PrefixFromDepth<K, TDepth> | ||
? PrefixFromDepth<string, TDepth> | ||
: object extends T | ||
? PrefixFromDepth<string, TDepth> | ||
: T extends readonly any[] & IsTuple<T> | ||
? PrefixTupleAccessor<T, AllowedIndexes<T>, TDepth> | ||
: T extends any[] | ||
? PrefixArrayAccessor<T, [...TDepth, any]> | ||
: T extends Date | ||
? never | ||
: T extends object | ||
? PrefixObjectAccessor<T, TDepth> | ||
: T extends string | number | boolean | bigint | ||
? '' | ||
: never | ||
: T extends readonly any[] & IsTuple<T> | ||
? PrefixTupleAccessor<T, AllowedIndexes<T>, TDepth> | ||
: T extends any[] | ||
? PrefixArrayAccessor<T, [...TDepth, any]> | ||
: T extends Date | ||
? never | ||
: T extends object | ||
? PrefixObjectAccessor<T, TDepth> | ||
: T extends string | number | boolean | bigint | ||
? '' | ||
: never | ||
@@ -90,0 +88,0 @@ type PrefixFromDepth< |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
426852
7320
+ Added@tanstack/store@0.4.1(transitive)
- Removed@tanstack/store@0.3.1(transitive)
Updated@tanstack/store@^0.4.1