Models
FUNCTION
@skmtc/core 0.63.4toModelName
A name for a model that differs between targets with one refName (…/properties/disk under two schemas). A component is named by its refName, through toComponentName. Any other target is named by its whole pointer, its segments joined by _: Order_items, Pet_properties_tag. A segment that is not alphanumeric gets a hash, so @type and type differ.
Signature
import { toModelName } from '@skmtc/core'
toModelName(
args: RefParts,
toComponentName?: (refName: string) => string
): stringParameters
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 #.
toComponentName, (refName: string) => string
Returns
string