Skip to content

Commit 78a1f4e

Browse files
committed
style: lint
1 parent 62e9cba commit 78a1f4e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/__tests__/datetime.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { afterEach, beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest';
1+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
2+
import type { MockInstance } from 'vitest';
23

34
import { parseDuration, sleep, toBasicISOString, toLocalISOString, yearsPassed } from '../datetime.js';
45

src/__tests__/exception.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type { Simplify } from 'type-fest';
22
import { describe, expect, expectTypeOf, it, test } from 'vitest';
33

4-
import { BaseException, ExceptionBuilder, type ExceptionConstructor, type ExceptionInstance } from '../exception.js';
4+
import { BaseException, ExceptionBuilder } from '../exception.js';
5+
6+
import type { ExceptionConstructor, ExceptionInstance } from '../exception.js';
57

68
type ExceptionOptionsWithCode = Simplify<ErrorOptions & { details: { code: number } }>;
79
type ExceptionOptionsWithCause = Simplify<ErrorOptions & { cause: Error }>;

src/exception.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type ExceptionParams = {
1515
name: string;
1616
};
1717

18-
export type ExceptionInstance<TParams extends ExceptionParams, TOptions extends ExceptionOptions> = Error & {
18+
type ExceptionInstance<TParams extends ExceptionParams, TOptions extends ExceptionOptions> = Error & {
1919
cause: TOptions['cause'];
2020
details: TOptions['details'];
2121
name: TParams['name'];
@@ -28,11 +28,11 @@ type ExceptionConstructorArgs<TParams extends ExceptionParams, TOptions extends
2828
? [TOptions]
2929
: [message: string, options: TOptions];
3030

31-
export type ExceptionConstructor<TParams extends ExceptionParams, TOptions extends ExceptionOptions> = new (
31+
type ExceptionConstructor<TParams extends ExceptionParams, TOptions extends ExceptionOptions> = new (
3232
...args: ExceptionConstructorArgs<TParams, TOptions>
3333
) => ExceptionInstance<TParams, TOptions>;
3434

35-
export abstract class BaseException<TParams extends ExceptionParams, TOptions extends ExceptionOptions>
35+
abstract class BaseException<TParams extends ExceptionParams, TOptions extends ExceptionOptions>
3636
extends Error
3737
implements ExceptionInstance<TParams, TOptions>
3838
{
@@ -47,7 +47,7 @@ export abstract class BaseException<TParams extends ExceptionParams, TOptions ex
4747
}
4848
}
4949

50-
export class ExceptionBuilder<TParams extends ExceptionParams | undefined, TOptions extends ExceptionOptions> {
50+
class ExceptionBuilder<TParams extends ExceptionParams | undefined, TOptions extends ExceptionOptions> {
5151
params?: TParams;
5252

5353
build(): [TParams] extends [ExceptionParams] ? ExceptionConstructor<TParams, TOptions> : never;
@@ -74,3 +74,6 @@ export class ExceptionBuilder<TParams extends ExceptionParams | undefined, TOpti
7474
return this as unknown as ExceptionBuilder<TUpdatedParams, TOptions>;
7575
}
7676
}
77+
78+
export type { ExceptionConstructor, ExceptionInstance };
79+
export { BaseException, ExceptionBuilder };

0 commit comments

Comments
 (0)