Skip to content

Instantly share code, notes, and snippets.

@leejh3224
Created April 9, 2021 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leejh3224/a852fa4fd4933100458775b7e539cbe6 to your computer and use it in GitHub Desktop.
Save leejh3224/a852fa4fd4933100458775b7e539cbe6 to your computer and use it in GitHub Desktop.
// A/getRepositoryName.ts
import { Repository } from "typeorm"
export function getRepositoryName(entity: EntityClass) {
if (entity instanceof Repository) {
return "validRepositoryName"
}
throw new Error("entity is not a valid typeorm Repository")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment