File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,15 @@ export interface NebuResult {
31
31
}
32
32
33
33
interface Nebu {
34
+ process < State extends object > (
35
+ input : string ,
36
+ plugin : Plugin < State > | PluginOption < State > [ ]
37
+ ) : NebuResult
34
38
process < State extends object > (
35
39
input : string ,
36
40
opts : NebuOptions < State >
37
41
) : NebuResult
42
+ process ( input : string , plugin : Plugin | PluginOption [ ] ) : NebuResult
38
43
process ( input : string , opts : NebuOptions ) : NebuResult
39
44
40
45
/**
@@ -50,7 +55,16 @@ interface Nebu {
50
55
}
51
56
52
57
export const nebu : Nebu = {
53
- process < State > ( input : string , opts : NebuOptions < State > ) : NebuResult {
58
+ process (
59
+ input : string ,
60
+ opts : NebuOptions < any > | Plugin < any > | PluginOption < any > [ ]
61
+ ) : NebuResult {
62
+ if ( Array . isArray ( opts ) ) {
63
+ opts = { plugins : opts }
64
+ } else if ( ! ( 'plugins' in opts ) ) {
65
+ opts = { plugins : [ opts ] }
66
+ }
67
+
54
68
const visitors = mergePlugins ( opts . plugins )
55
69
if ( ! visitors . size ) {
56
70
return { js : input }
You can’t perform that action at this time.
0 commit comments