From 1be7a653f6f5a0370c5fdb2df3c509b2695f2904 Mon Sep 17 00:00:00 2001 From: Will Soto Date: Fri, 29 Sep 2023 19:06:54 -0400 Subject: [PATCH] style: format files Signed-off-by: Will Soto --- README.md | 19 ++++++++++--------- src/core.ts | 2 +- src/module.ts | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 43f097a4..0e426a07 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,10 @@ pnpm add knex objection #### `ObjectionModule.register` ```typescript -import { ObjectionModule } from "@willsoto/nestjs-objection"; import { Module } from "@nestjs/common"; -import knex from "knex"; -import { knexSnakeCaseMappers } from "objection"; -import { ConfigModule, ConfigService } from "../config"; -import { User } from "./user"; +import { ObjectionModule } from "@willsoto/nestjs-objection"; import { BaseModel } from "./base"; +import { User } from "./user"; @Module({ imports: [ @@ -79,13 +76,13 @@ export class DatabaseModule {} #### `ObjectionModule.registerAsync` ```typescript -import { ObjectionModule } from "@willsoto/nestjs-objection"; import { Module } from "@nestjs/common"; +import { ObjectionModule } from "@willsoto/nestjs-objection"; import knex from "knex"; import { knexSnakeCaseMappers } from "objection"; import { ConfigModule, ConfigService } from "../config"; -import { User } from "./user"; import { BaseModel } from "./base"; +import { User } from "./user"; @Module({ imports: [ @@ -127,7 +124,11 @@ export class DatabaseModule {} ```ts import { Inject, Injectable } from "@nestjs/common"; -import { HealthIndicatorResult, HealthIndicator, HealthCheckError } from "@nestjs/terminus"; +import { + HealthCheckError, + HealthIndicator, + HealthIndicatorResult, +} from "@nestjs/terminus"; import { Connection, KNEX_CONNECTION } from "@willsoto/nestjs-objection"; @Injectable() @@ -149,7 +150,7 @@ export class PrimaryDatabaseHealthIndicator extends HealthIndicator { ### Injecting an objection model ```ts -import { Injectable, Inject } from "@nestjs/common"; +import { Inject, Injectable } from "@nestjs/common"; import { User } from "./user"; @Injectable() diff --git a/src/core.ts b/src/core.ts index 44622785..c73980d2 100644 --- a/src/core.ts +++ b/src/core.ts @@ -9,7 +9,7 @@ import { ValueProvider, } from "@nestjs/common"; import { ModuleRef } from "@nestjs/core"; -import { knex, Knex } from "knex"; +import { Knex, knex } from "knex"; import { Model } from "objection"; import { KNEX_CONNECTION, diff --git a/src/module.ts b/src/module.ts index be60e45e..35c5150a 100644 --- a/src/module.ts +++ b/src/module.ts @@ -27,7 +27,7 @@ export class ObjectionModule { }; } - public static forFeature(models: typeof Model[]): DynamicModule { + public static forFeature(models: (typeof Model)[]): DynamicModule { const modelProviders: Provider[] = models.flatMap((model) => { return [ {