Skip to content

Commit

Permalink
style: formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Aug 12, 2023
1 parent 592acdf commit 77e6fe4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function myFunction(example: Example) {

### Configuration

```ts
````ts
export interface PrismaJsonTypesGeneratorConfig {
/**
* The namespace to generate the types in.
Expand Down Expand Up @@ -136,7 +136,7 @@ export interface PrismaJsonTypesGeneratorConfig {
*/
allowAny?: boolean;
}
```
````

### How it works

Expand Down
4 changes: 2 additions & 2 deletions src/handler/model-payload.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ts from 'typescript';
import type { ModelWithRegex } from '../helpers/dmmf';
import { replaceObject } from './replace-object';
import { PrismaJsonTypesGeneratorConfig } from '../util/config';
import type { DeclarationWriter } from '../util/declaration-writer';
import { PrismaJsonTypesGeneratorError } from '../util/error';
import { replaceObject } from './replace-object';

/** Replacer responsible for the main <Model>Payload type. */
export function handleModelPayload(
Expand Down Expand Up @@ -43,5 +43,5 @@ export function handleModelPayload(
}

// Replaces this object
return replaceObject(object, writer, model, config);
return replaceObject(object, writer, model, config);
}
4 changes: 2 additions & 2 deletions src/handler/replace-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { ModelWithRegex } from '../helpers/dmmf';
import { findNewSignature } from '../helpers/find-signature';
import { JSON_REGEX } from '../helpers/regex';
import { PrismaJsonTypesGeneratorConfig } from '../util/config';
import { createType } from '../util/create-signature';
import type { DeclarationWriter } from '../util/declaration-writer';
import { PrismaJsonTypesGeneratorError } from '../util/error';
import { createType } from '../util/create-signature';

/** Tries to replace every property of an object */
export function replaceObject(
Expand Down Expand Up @@ -44,7 +44,7 @@ export function replaceObject(
});
}

const newType = createType(field.documentation, config)
const newType = createType(field.documentation, config);

const newSignature = findNewSignature(
signature.getText(),
Expand Down
2 changes: 1 addition & 1 deletion src/handler/statement.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ts from 'typescript';
import type { ModelWithRegex } from '../helpers/dmmf';
import { replaceObject } from './replace-object';
import { PrismaJsonTypesGeneratorConfig } from '../util/config';
import { DeclarationWriter } from '../util/declaration-writer';
import { handleModelPayload } from './model-payload';
import { replaceObject } from './replace-object';

/**
* Handles a Prisma namespace statement, can be a model type, a model payload or a model
Expand Down
2 changes: 1 addition & 1 deletion src/on-generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function onGenerate(options: GeneratorOptions) {
handlePrismaModule(child as ts.ModuleDeclaration, writer, prismaModels, config);
}
} catch (error) {
console.log(error)
console.log(error);
}
});

Expand Down

0 comments on commit 77e6fe4

Please sign in to comment.