mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Drop support for undef input where opts also provided #1768
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user