Skip to content

Commit

Permalink
chore(kmore-cli): lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Oct 29, 2024
1 parent 35be05b commit ae72918
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion packages/kmore-cli/src/lib/process-opts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,17 @@ export function mergeOptions<T extends object>(


export function parseMultiValue(arg: unknown): string[] {
const arr = arg ? String(arg).split(',') : []
let arr: string[] = []
if (typeof arg === 'string') {
arr = arg.split(',')
}
else if (typeof arg === 'object' && arg !== null) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
arr = Object.values(arg)
}
else {
throw new Error('Invalid path value')
}
const ret: string[] = []

if (arr.length) {
Expand Down
2 changes: 1 addition & 1 deletion packages/kmore-cli/src/lib/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async function ifFileContentContainsCallerFuncNames(

void maxLines

const content = await readFile(path, 'utf-8')
const content = await readFile(path, 'utf8')
const ret = hasContainsCallerFuncNames(matchFuncNameSet, content)
return ret
}
Expand Down

0 comments on commit ae72918

Please sign in to comment.