## getPathDifference() function

Returns the difference between two paths which is often suitable to use as a key in a `Record<string, InternalSchemaElement>`

**Signature:**

```typescript
export declare function getPathDifference(parentPath: string, path: string): string | undefined;
```

## Parameters

| Parameter   | Type   | Description                                                                                      |
|-------------|--------|--------------------------------------------------------------------------------------------------|
| parentPath  | string | The parent path that will be removed from `path`.                                              |
| path        | string | The element path that should be a child of `parentPath`.                                       |

**Returns:**

string | undefined

- The difference between `path` and `parentPath` or `undefined` if `path` is not a child of `parentPath`.

- [getPathDifference() function](/content/docs/sdk/core.getpathdifference#getpathdifference-function/index.html)
- [Parameters](/content/docs/sdk/core.getpathdifference#parameters/index.html)
