postman-sandbox
Version:
Sandbox for Postman Scripts to run in Node.js or browser
25 lines (22 loc) • 678 B
JavaScript
const NOT_IMPLEMENTED = function () {
throw new Error('Not implemented');
};
function getBufferModule (buffer) {
return {
Buffer: buffer.Buffer,
SlowBuffer: buffer.SlowBuffer,
INSPECT_MAX_BYTES: buffer.INSPECT_MAX_BYTES,
kMaxLength: buffer.kMaxLength,
kStringMaxLength: buffer.kStringMaxLength,
constants: buffer.constants,
File: buffer.File,
Blob: buffer.Blob,
atob: buffer.atob,
btoa: buffer.btoa,
isAscii: NOT_IMPLEMENTED,
isUtf8: NOT_IMPLEMENTED,
resolveObjectURL: NOT_IMPLEMENTED,
transcode: NOT_IMPLEMENTED
}
}
module.exports = getBufferModule;