mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Allow instance reuse with differing toBuffer options (#1860)
This commit is contained in:
committed by
Lovell Fuller
parent
69fe21a7ec
commit
fb5c393fbd
@@ -92,6 +92,8 @@ function toFile (fileOut, callback) {
|
||||
function toBuffer (options, callback) {
|
||||
if (is.object(options)) {
|
||||
this._setBooleanOption('resolveWithObject', options.resolveWithObject);
|
||||
} else if (this.options.resolveWithObject) {
|
||||
this.options.resolveWithObject = false;
|
||||
}
|
||||
return this._pipeline(is.fn(options) ? options : callback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user