Skip to content

Commit 2def896

Browse files
committed
refactor(decorator): split files
1 parent dc6dedd commit 2def896

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/decorators/log-message.decorator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
22
type DescriptorFn,
33
type DefaultDecoratorArgs,
4-
} from '@/decorators/types';
5-
import { createDecorator } from '@/decorators/utils';
4+
} from '@/types/decorators.type';
5+
import { createDecorator } from '@/utils/decorators';
66

77
interface LogMessageDecoratorArgs {
88
message: string;

src/decorators/types.ts renamed to src/types/decorators.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export type DefaultDecoratorArgs = [unknown];
99
*/
1010
export type DecoratorArgs<
1111
T extends DefaultDecoratorArgs = DefaultDecoratorArgs,
12-
> = T extends [] ? [string, number] : T;
12+
> = T extends never[] ? [string, number] : T;
1313

1414
/**
1515
* Function type definition for a decorator. This function can accept multiple arguments based on `TArgs`

src/types/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export type * as Environment from './environment.type';
2+
export type * as Common from './common.type';
3+
export type * as Decorators from './decorators.type';

src/decorators/utils.ts renamed to src/utils/decorators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
type DefaultDecoratorArgs,
44
type DescriptorFn,
55
type GeneratedDecorator,
6-
} from './types';
6+
} from '@/types/decorators.type';
77
import logger from '@/lib/logger';
88

99
/**

0 commit comments

Comments
 (0)