Data pasted into the input is treat as a file if it's over the IO threshold

This commit is contained in:
n1474335 2018-01-06 15:29:58 +00:00
parent 2d9f87abef
commit 4588cd151c
5 changed files with 54 additions and 12 deletions

View file

@ -80,7 +80,7 @@ Chef.prototype.bake = async function(input, recipeConfig, options, progress, ste
// Depending on the size of the output, we may send it back as a string or an ArrayBuffer.
// This can prevent unnecessary casting as an ArrayBuffer can be easily downloaded as a file.
// The threshold is specified in KiB.
const threshold = (options.outputFileThreshold || 1024) * 1024;
const threshold = (options.ioDisplayThreshold || 1024) * 1024;
const returnType = this.dish.size() > threshold ? Dish.ARRAY_BUFFER : Dish.STRING;
return {