-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Hi, nice lib.
In my opinion OptionsForHtmlFileAsValidationTargetAndObjectAsResult
and OptionsForExternalUrlAsValidationTargetAndObjectAsResult
should mark format
as required, even if it contains only single value, because typings are not fulfilled in below case:
// JSON options
const options:
| htmlValidator.OptionsForHtmlFileAsValidationTargetAndObjectAsResult
| htmlValidator.OptionsForExternalUrlAsValidationTargetAndObjectAsResult
= {
data: args.html,
isFragment: true
};
// JSON response
let result: htmlValidator.ParsedJsonAsValidationResults;
try{
result = await htmlValidator(options);
...
result.messages.length
In above case I expect result
to be JSON, instead string
is returned until format: 'json'
is provided explicitly. This causes runtime error but should be detected during compilation.
Metadata
Metadata
Assignees
Labels
No labels