Skip to main content

Function: joinPath()

joinPath(parent, key): string

Defined in: packages/core/src/utils.ts:42

Join a parent path and a child key with a dot separator. Returns key directly when parent is undefined or empty.

Parameters​

parent​

string | undefined

The parent path (e.g. "address") or undefined for top-level fields.

key​

string

The child field key to append (e.g. "street").

Returns​

string

The joined path (e.g. "address.street") or key when parent is absent.

Examples​

joinPath('address', 'street') → 'address.street'
joinPath(undefined, 'name') → 'name'