Skip to content

Commit

Permalink
Use types instead of interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Oct 21, 2024
1 parent 8bba409 commit 3af4ba5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class Finder {
* Creates a new finder.
* @param options An object providing values to initialize this instance.
*/
constructor(options: Partial<FinderOptions> = {}) {
constructor(options: FinderOptions = {}) {
let {extensions = [], paths = []} = options;

if (!extensions.length) {
Expand Down Expand Up @@ -118,7 +118,7 @@ export class Finder {
/**
* Defines the options of a {@link Finder} instance.
*/
export interface FinderOptions {
export type FinderOptions = Partial<{

/**
* The list of executable file extensions.
Expand All @@ -129,4 +129,4 @@ export interface FinderOptions {
* The list of system paths.
*/
paths: Array<string>;
}
}>;
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export * from "./result_set.js";
* @param options The options to be passed to the finder.
* @returns The search results.
*/
export default function which(command: string, options: Partial<FinderOptions> = {}): ResultSet {
export default function which(command: string, options: FinderOptions = {}): ResultSet {
return new ResultSet(command, new Finder(options));
}

0 comments on commit 3af4ba5

Please sign in to comment.