# toModelKey

FUNCTION in `@skmtc/core 0.63.4`

The key a model is known by in the engine: its generator key, its
enrichments (`[id][key][variant]`) and its manifest entry. A component
(`refPath` `#/components/schemas`) is keyed by its `refName`, as it always
was. Any other target is keyed by its whole pointer (`toRefPointer`),
so two targets that share a `refName` stay apart.

## Signature

```ts
import { toModelKey } from '@skmtc/core'

toModelKey(args: RefParts): string
```

## Parameters

- `args` (RefParts, required)
  - `refName` (RefName, required): The last segment of the pointer, unescaped. Empty for a `$ref` that ends in `/`.
  - `refPath` (string, required): The pointer before the last segment, starting with `#`, with no percent escapes. A remote `$ref` (`isRemoteRefPath`) has the file before the `#`.

## Returns

`string`
