Skip to content

Commit

Permalink
fix(types): add Nested generic to createUnplugin (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanzmj committed Nov 18, 2022
1 parent 5a8544d commit 971df69
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/define.ts
Expand Up @@ -4,13 +4,7 @@ import type { UnpluginFactory, UnpluginInstance } from './types'
import { getVitePlugin } from './vite'
import { getWebpackPlugin } from './webpack'

export function createUnplugin<UserOptions>(
factory: UnpluginFactory<UserOptions, false>
): UnpluginInstance<UserOptions, false>
export function createUnplugin<UserOptions>(
factory: UnpluginFactory<UserOptions, true>
): UnpluginInstance<UserOptions, true>
export function createUnplugin<UserOptions, Nested extends boolean>(
export function createUnplugin<UserOptions, Nested extends boolean = boolean>(
factory: UnpluginFactory<UserOptions, Nested>,
): UnpluginInstance<UserOptions, Nested> {
return {
Expand Down

0 comments on commit 971df69

Please sign in to comment.