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

ParameterTypeDescription
parentPathstringThe parent path that will be removed from path.
pathstringThe 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.