Skip to main content

core.getpathdifference

Home > @medplum/core > getPathDifference

getPathDifference() function

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

Signature:

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.