Drop support for undef input where opts also provided #1768

This commit is contained in:
Lovell Fuller
2020-01-11 12:02:31 +00:00
parent a8a0c1e935
commit 7dbad7206e
3 changed files with 31 additions and 13 deletions

View File

@@ -23,11 +23,13 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
// Raw Stream
inputDescriptor.buffer = [];
}
} else if (!is.defined(input) && is.object(containerOptions) && containerOptions.allowStream) {
} else if (!is.defined(input) && !is.defined(inputOptions) && is.object(containerOptions) && containerOptions.allowStream) {
// Stream
inputDescriptor.buffer = [];
} else {
throw new Error('Unsupported input ' + typeof input);
throw new Error(`Unsupported input '${input}' of type ${typeof input}${
is.defined(inputOptions) ? ` when also providing options of type ${typeof inputOptions}` : ''
}`);
}
if (is.object(inputOptions)) {
// Fail on error