@@ -5,12 +5,12 @@ import { dirname } from 'node:path'
55import { join } from 'pathe'
66import { hash } from 'ohash'
77
8- interface Options {
8+ interface LocalOptionSearchOptions {
99 root : string
1010 key ?: string | boolean
1111}
1212
13- export async function readLocalOptions < T > ( defaults : T , options : Options ) : Promise < T > {
13+ export async function readLocalOptions < T > ( defaults : T , options : LocalOptionSearchOptions ) : Promise < T > {
1414 const { filePath } = getOptionsFilepath ( options )
1515
1616 if ( existsSync ( filePath ) ) {
@@ -25,7 +25,7 @@ export async function readLocalOptions<T>(defaults: T, options: Options): Promis
2525 }
2626}
2727
28- function getOptionsFilepath ( options : Options ) {
28+ function getOptionsFilepath ( options : LocalOptionSearchOptions ) {
2929 let hashedKey
3030 if ( options . key )
3131 hashedKey = hash ( `${ options . root } :${ options . key } ` )
@@ -38,13 +38,13 @@ function getOptionsFilepath(options: Options) {
3838 }
3939}
4040
41- export async function clearLocalOptions ( options : Options ) {
41+ export async function clearLocalOptions ( options : LocalOptionSearchOptions ) {
4242 const { filePath } = getOptionsFilepath ( options )
4343 if ( existsSync ( filePath ) )
4444 await fs . unlink ( filePath )
4545}
4646
47- export async function writeLocalOptions < T > ( settings : T , options : Options ) {
47+ export async function writeLocalOptions < T > ( settings : T , options : LocalOptionSearchOptions ) {
4848 const { filePath, hashedKey } = getOptionsFilepath ( options )
4949
5050 await fs . mkdir ( dirname ( filePath ) , { recursive : true } )
0 commit comments