Skip to content

Commit

Permalink
fix: allow jsonFormat with format:html
Browse files Browse the repository at this point in the history
  • Loading branch information
is2ei committed May 21, 2022
1 parent b83d922 commit f1f28e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ interface ListRender {
interface ListOptions {
names?: string[];
extendedFolderInfo?: boolean;
jsonFormat?: 'names' | 'extended';
}

interface ListOptionsJsonFormat extends ListOptions {
format: 'json';
jsonFormat?: 'names' | 'extended';
// Required when the URL parameter `format=html` exists
render?: ListRender;
}
Expand Down
3 changes: 0 additions & 3 deletions lib/dirList.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ const dirList = {
if (options.list.format === 'html' && typeof options.list.render !== 'function') {
return new TypeError('The `list.render` option must be a function and is required with html format')
}
if (options.list.format === 'html' && options.list.jsonFormat != null) {
return new TypeError('The `list.jsonFormat` option must be with json format')
}
}

}
Expand Down

0 comments on commit f1f28e6

Please sign in to comment.