From 3af4ba51271f7e379d11ec120190c854772dfb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Mon, 21 Oct 2024 14:33:50 +0200 Subject: [PATCH] Use `type`s instead of `interface`s --- src/finder.ts | 6 +++--- src/index.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/finder.ts b/src/finder.ts index dc963e8..f7ccb4e 100644 --- a/src/finder.ts +++ b/src/finder.ts @@ -22,7 +22,7 @@ export class Finder { * Creates a new finder. * @param options An object providing values to initialize this instance. */ - constructor(options: Partial = {}) { + constructor(options: FinderOptions = {}) { let {extensions = [], paths = []} = options; if (!extensions.length) { @@ -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. @@ -129,4 +129,4 @@ export interface FinderOptions { * The list of system paths. */ paths: Array; -} +}>; diff --git a/src/index.ts b/src/index.ts index f098179..351a8a8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 = {}): ResultSet { +export default function which(command: string, options: FinderOptions = {}): ResultSet { return new ResultSet(command, new Finder(options)); }