MCPcopy Index your code
hub / github.com/TanStack/form / getBy

Function getBy

packages/form-core/src/utils.ts:34–43  ·  view source on GitHub ↗
(obj: any, path: any)

Source from the content-addressed store, hash-verified

32 * @private
33 */
34export function getBy(obj: any, path: any) {
35 const pathObj = makePathArray(path)
36 return pathObj.reduce((current: any, pathPart: any) => {
37 if (current === null) return null
38 if (typeof current !== 'undefined') {
39 return current[pathPart]
40 }
41 return undefined
42 }, obj)
43}
44
45/**
46 * Set a value on an object using a path, including dot notation.

Callers 5

constructorMethod · 0.90
constructorMethod · 0.90
FormApiClass · 0.90
FieldApiClass · 0.90
utils.spec.tsFile · 0.85

Calls 1

makePathArrayFunction · 0.85

Tested by

no test coverage detected