Skip to content

Commit

Permalink
style: format files
Browse files Browse the repository at this point in the history
Signed-off-by: Will Soto <willsoto@users.noreply.github.com>
  • Loading branch information
willsoto committed Sep 29, 2023
1 parent fa84978 commit 1be7a65
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
{
Expand Down

0 comments on commit 1be7a65

Please sign in to comment.