1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00
denoland-deno/ext/node/polyfills/internal/streams/state.mjs

26 lines
787 B
JavaScript
Raw Normal View History

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
// deno-lint-ignore-file
// TODO(bartlomieju): this should be 64?
let defaultHighWaterMarkBytes = 16 * 1024;
let defaultHighWaterMarkObjectMode = 16;
function getDefaultHighWaterMark(objectMode) {
return objectMode
? defaultHighWaterMarkObjectMode
: defaultHighWaterMarkBytes;
}
function setDefaultHighWaterMark(objectMode, value) {
validateInteger(value, "value", 0);
if (objectMode) {
defaultHighWaterMarkObjectMode = value;
} else {
defaultHighWaterMarkBytes = value;
}
}
export default { getDefaultHighWaterMark, setDefaultHighWaterMark };
export { getDefaultHighWaterMark, setDefaultHighWaterMark };