mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ctor single arg: allow plain object, reject null/undefined
Thank you @kub1x
This commit is contained in:
@@ -16,6 +16,9 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
|
||||
} else if (is.buffer(input)) {
|
||||
// Buffer
|
||||
inputDescriptor.buffer = input;
|
||||
} else if (is.plainObject(input) && !is.defined(inputOptions)) {
|
||||
// Plain Object descriptor, e.g. create
|
||||
inputOptions = input;
|
||||
} else if (!is.defined(input) && is.object(containerOptions) && containerOptions.allowStream) {
|
||||
// Stream
|
||||
inputDescriptor.buffer = [];
|
||||
|
||||
Reference in New Issue
Block a user