@tanstack/form-core 0.23.1 → 0.23.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils.ts CHANGED
@@ -8,6 +8,9 @@ export type Updater<TInput, TOutput = TInput> =
8
8
  | TOutput
9
9
  | UpdaterFn<TInput, TOutput>
10
10
 
11
+ /**
12
+ * @private
13
+ */
11
14
  export function functionalUpdate<TInput, TOutput = TInput>(
12
15
  updater: Updater<TInput, TOutput>,
13
16
  input: TInput,
@@ -19,6 +22,7 @@ export function functionalUpdate<TInput, TOutput = TInput>(
19
22
 
20
23
  /**
21
24
  * Get a value from an object using a path, including dot notation.
25
+ * @private
22
26
  */
23
27
  export function getBy(obj: any, path: any) {
24
28
  const pathObj = makePathArray(path)
@@ -33,6 +37,7 @@ export function getBy(obj: any, path: any) {
33
37
 
34
38
  /**
35
39
  * Set a value on an object using a path, including dot notation.
40
+ * @private
36
41
  */
37
42
  export function setBy(obj: any, _path: any, updater: Updater<any>) {
38
43
  const path = makePathArray(_path)
@@ -75,6 +80,7 @@ export function setBy(obj: any, _path: any, updater: Updater<any>) {
75
80
 
76
81
  /**
77
82
  * Delete a field on an object using a path, including dot notation.
83
+ * @private
78
84
  */
79
85
  export function deleteBy(obj: any, _path: any) {
80
86
  const path = makePathArray(_path)
@@ -130,6 +136,9 @@ const reFindMultiplePeriods = /\.{2,}/gm
130
136
  const intPrefix = '__int__'
131
137
  const intReplace = `${intPrefix}$1`
132
138
 
139
+ /**
140
+ * @private
141
+ */
133
142
  export function makePathArray(str: string) {
134
143
  if (typeof str !== 'string') {
135
144
  throw new Error('Path must be a string.')
@@ -152,6 +161,9 @@ export function makePathArray(str: string) {
152
161
  })
153
162
  }
154
163
 
164
+ /**
165
+ * @private
166
+ */
155
167
  export function isNonEmptyArray(obj: any) {
156
168
  return !(Array.isArray(obj) && obj.length === 0)
157
169
  }
@@ -161,12 +173,18 @@ interface AsyncValidatorArrayPartialOptions<T> {
161
173
  asyncDebounceMs?: number
162
174
  }
163
175
 
176
+ /**
177
+ * @private
178
+ */
164
179
  export interface AsyncValidator<T> {
165
180
  cause: ValidationCause
166
181
  validate: T
167
182
  debounceMs: number
168
183
  }
169
184
 
185
+ /**
186
+ * @private
187
+ */
170
188
  export function getAsyncValidatorArray<T>(
171
189
  cause: ValidationCause,
172
190
  options: AsyncValidatorArrayPartialOptions<T>,
@@ -240,11 +258,17 @@ interface SyncValidatorArrayPartialOptions<T> {
240
258
  validators?: T
241
259
  }
242
260
 
261
+ /**
262
+ * @private
263
+ */
243
264
  export interface SyncValidator<T> {
244
265
  cause: ValidationCause
245
266
  validate: T
246
267
  }
247
268
 
269
+ /**
270
+ * @private
271
+ */
248
272
  export function getSyncValidatorArray<T>(
249
273
  cause: ValidationCause,
250
274
  options: SyncValidatorArrayPartialOptions<T>,