From 5a0c42e1f01e363cbf34e515747830fb2f68013f Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Mon, 14 Sep 2020 15:21:19 +0200 Subject: [PATCH] prettier --- .prettierrc | 8 ++++++++ src/index.ts | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..a0196b4 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "tabWidth": 2, + "useTabs": false, + "printWidth": 250, + "singleQuote": true, + "semi": false, + "trailingComma": "es5" +} diff --git a/src/index.ts b/src/index.ts index a43ae36..b5bfeee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,6 +53,9 @@ export abstract class BaseEntity { static persist(this: ObjectType, ...args: Parameters['persist']>): ReturnType['persist']> { return (this as any).getRepo().persist(...args) } + static persistAndFlush(this: ObjectType, ...args: Parameters['persistAndFlush']>): ReturnType['persistAndFlush']> { + return (this as any).getRepo().persist(...args) + } static populate(this: ObjectType, ...args: Parameters['populate']>): ReturnType['populate']> { return (this as any).getRepo().populate(...args) } @@ -61,4 +64,4 @@ export abstract class BaseEntity { } } -export const register = (db: MikroORM) => (orm = db) +export const register = >(db: MikroORM) => (orm = db)