@@ -8,37 +8,13 @@ import type { BunPlugin } from 'bun';
8
8
import type { UnpluginContextMeta } from 'unplugin' ;
9
9
import { hasCJSSyntax } from 'mlly' ;
10
10
import { resolveOptions , unplugin } from './api.js' ;
11
- import { type Options , type ResolvedOptions , defaultOptions } from './core/options.js' ;
11
+ import { type Options , defaultOptions } from './core/options.js' ;
12
12
import { isBun } from './core/utils.js' ;
13
13
14
14
if ( ! isBun ( ) ) {
15
15
throw new Error ( 'You must use this plugin with bun' ) ;
16
16
}
17
17
18
- /**
19
- * Options for the bun plugin.
20
- */
21
- export interface BunOptions extends Options {
22
-
23
- /**
24
- * Whether to resolve the typia mjs path absolutely.
25
- *
26
- * @default true
27
- */
28
- resolveAbsoluteTypiaPath ?: boolean ;
29
- }
30
-
31
- type ResolvedBunOptions = ResolvedOptions & Required < Pick < BunOptions , 'resolveAbsoluteTypiaPath' > > ;
32
-
33
- function resolveBunOptions ( options : BunOptions ) {
34
- const resolvedOptions = resolveOptions ( options ) ;
35
-
36
- return {
37
- ...resolvedOptions ,
38
- resolveAbsoluteTypiaPath : options . resolveAbsoluteTypiaPath ?? true ,
39
- } satisfies ResolvedBunOptions ;
40
- }
41
-
42
18
/**
43
19
* bun plugin
44
20
*
@@ -88,7 +64,7 @@ function resolveBunOptions(options: BunOptions) {
88
64
* When you run your scripts on Bun.runtime, You cannot use named import for typia value in the source code. Check out the README.md.
89
65
*/
90
66
function bunTypiaPlugin (
91
- options ?: BunOptions ,
67
+ options ?: Options ,
92
68
) : BunPlugin {
93
69
const unpluginRaw = unplugin . raw (
94
70
options ,
@@ -104,7 +80,7 @@ function bunTypiaPlugin(
104
80
const bunPlugin = ( {
105
81
name : 'unplugin-typia' ,
106
82
async setup ( build ) {
107
- const resolvedOptions = resolveBunOptions ( options ?? { } ) ;
83
+ const resolvedOptions = resolveOptions ( options ?? { } ) ;
108
84
const { include } = resolvedOptions ;
109
85
110
86
const filter = include instanceof RegExp
0 commit comments