Allow Restricted Notebooks to export text (#6542)
* Refactor string to stream * add to restricted notebooks and allow for blank users * forgot to add notebook * use better types and fix test * move streamToString * add export group * catch blank pages
This commit is contained in:
@@ -150,3 +150,17 @@ exports.test = test.extend({
|
||||
}
|
||||
});
|
||||
exports.expect = expect;
|
||||
|
||||
/**
|
||||
* Takes a readable stream and returns a string.
|
||||
* @param {ReadableStream} readable - the readable stream
|
||||
* @return {Promise<String>} the stringified stream
|
||||
*/
|
||||
exports.streamToString = async function (readable) {
|
||||
let result = '';
|
||||
for await (const chunk of readable) {
|
||||
result += chunk;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user