getName
Typings:
function getName<U extends AnyParamConstructor<any>>(cl: U, overwriteOptions?: IModelOptions)
Parameters:
Name | Type | Description |
---|---|---|
cl Required | U | The Class to get a name from / for |
overwriteOptions | IModelOptions | Overwrite select IModelOptions for name generation |
getName
generates the name of the given Class (cl
) with the given OverwriteOptions (overwriteOptions
).
Example
class Kitten {}
getName(Kitten); // "Kitten"
@modelOptions({ options: { customName: 'SomeRandomKitten' } })
class Kitten2 {}
getName(Kitten); // "SomeRandomKitten"
@modelOptions({ schemaOptions: { collection: 'RandomKittens' }, options: { automaticName: true } })
class Kitten3 {}
getName(Kitten); // "Kitten3_RandomKittens"