Skip to content

Commit

Permalink
fix: don't specify default value for include & exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed May 16, 2024
1 parent 208b58d commit 41d4778
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U
export type OptionsResolved = Overwrite<
Required<BaseOptions>,
{
include: BaseOptions['include']
exclude: BaseOptions['exclude']
enforce: BaseOptions['enforce']
values: ReplaceItem[]
}
>

export function resolveOptions(options: Options): OptionsResolved {
return {
include: options.include || [/\.[cm]?[jt]sx?$/],
exclude: options.exclude || [/node_modules/],
include: options.include,
exclude: options.exclude,
sourceMap: options.sourceMap ?? true,
delimiters: options.delimiters || ['\\b', '\\b(?!\\.)'],
preventAssignment: options.preventAssignment ?? false,
Expand Down

0 comments on commit 41d4778

Please sign in to comment.