Skip to content

fix: update the type of the defaultFilter#338

Merged
pacocoursey merged 1 commit into
dip:mainfrom
muZk:main
Mar 14, 2025
Merged

fix: update the type of the defaultFilter#338
pacocoursey merged 1 commit into
dip:mainfrom
muZk:main

Conversation

@muZk

@muZk muZk commented Jan 17, 2025

Copy link
Copy Markdown
Contributor

In #229, the defaultFilter was exported, but its type is currently defined as CommandProps['filter'], which is:

filter?: (value: string, search: string, keywords?: string[]) => number;

This means the TypeScript compiler treats defaultFilter as a function or undefined. However, defaultFilter is intended always to be present.

This PR updates the type definition to ensure defaultFilter is consistently defined as a function, eliminating the (false 🤭 ) possibility of it being undefined.

@vercel

vercel Bot commented Jan 17, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
cmdk-website ✅ Ready (Inspect) Visit Preview Jan 17, 2025 7:10pm

@igor9silva

Copy link
Copy Markdown

cc @pacocoursey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants