Skip to content

Commit

Permalink
fix(types): fields in experimental.search can be optional (#2506)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 17, 2024
1 parent d41902a commit 2d7188b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export interface ModuleOptions {
*
* @default true
*/
indexed: boolean
indexed?: boolean
/**
* MiniSearch Options. When using `indexed` option,
* this options will be used to configure MiniSearch
Expand All @@ -293,7 +293,7 @@ export interface ModuleOptions {
*
* @see https://lucaong.github.io/minisearch/modules/_minisearch_.html#options
*/
options: MiniSearchOptions
options?: MiniSearchOptions
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const defineMiniSearchOptions = <DataItem>(options: MiniSearchOptions<Dat
return ref(options)
}

export const searchContent = async <DataItem>(search: MaybeRefOrGetter<string>, options: { miniSearch?: MaybeRefOrGetter<MiniSearchOptions<DataItem>> }) => {
export const searchContent = async <DataItem>(search: MaybeRefOrGetter<string>, options: { miniSearch?: MaybeRefOrGetter<MiniSearchOptions<DataItem>> } = {}) => {
const runtimeConfig = useRuntimeConfig()
const { content } = runtimeConfig.public
const { integrity, api: { baseURL: baseAPI }, search: searchOptions } = content
Expand Down

0 comments on commit 2d7188b

Please sign in to comment.