Skip to content

Commit

Permalink
fix: remvoe index option from ogma options interface (#1737)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 authored Jul 9, 2023
2 parents 96fa2a4 + cd6a897 commit 3abb979
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-eels-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ogma/nestjs-module': patch
---

Update the service options provider to correctly pass on the options to the ogma creation process
5 changes: 5 additions & 0 deletions .changeset/loud-mice-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ogma/logger': patch
---

Removed the index type from the ogma options to allow for better intellisense
1 change: 0 additions & 1 deletion packages/logger/src/interfaces/ogma-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export interface OgmaOptions {
* desired.
*/
each: boolean;
[index: string]: any;
}

const stream = process
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-module/src/ogma.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function createOgmaProvider(options?: Partial<OgmaOptions>): Ogma {
}

export function createOgmaServiceOptions(options: OgmaModuleOptions): OgmaModuleOptions {
return options.service;
return options;
}

export function createOgmaTraceOptions(options: OgmaModuleOptions): Lowercase<OgmaWritableLevel> {
Expand Down
11 changes: 4 additions & 7 deletions packages/nestjs-module/test/ogma.provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@ CreateOgmaInterceptorOptionsFactorySuite.run();

const CreateOgmaServiceOptionsSuite = suite('Create Ogma Service Options');
CreateOgmaServiceOptionsSuite('Should return the service options', () => {
is(createOgmaServiceOptions({ interceptor: {} }), undefined);
equal(createOgmaServiceOptions({}), {});
});
CreateOgmaServiceOptionsSuite('Should return actual options and not undefined', () => {
equal(
createOgmaServiceOptions({
interceptor: {},
service: {
json: false,
color: true,
application: 'something',
},
json: false,
color: true,
application: 'something',
}),
{
color: true,
Expand Down

0 comments on commit 3abb979

Please sign in to comment.