2024-08-13 01:41:32 +09:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-02-14 17:38:45 +01:00
|
|
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
|
|
|
// deno-lint-ignore-file
|
|
|
|
|
2024-09-12 00:02:50 +01:00
|
|
|
// TODO(bartlomieju): this should be 64?
|
|
|
|
let defaultHighWaterMarkBytes = 16 * 1024;
|
|
|
|
let defaultHighWaterMarkObjectMode = 16;
|
|
|
|
|
2023-02-14 17:38:45 +01:00
|
|
|
function getDefaultHighWaterMark(objectMode) {
|
2024-09-12 00:02:50 +01:00
|
|
|
return objectMode
|
|
|
|
? defaultHighWaterMarkObjectMode
|
|
|
|
: defaultHighWaterMarkBytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setDefaultHighWaterMark(objectMode, value) {
|
|
|
|
validateInteger(value, "value", 0);
|
|
|
|
if (objectMode) {
|
|
|
|
defaultHighWaterMarkObjectMode = value;
|
|
|
|
} else {
|
|
|
|
defaultHighWaterMarkBytes = value;
|
|
|
|
}
|
2023-02-14 17:38:45 +01:00
|
|
|
}
|
|
|
|
|
2024-09-12 00:02:50 +01:00
|
|
|
export default { getDefaultHighWaterMark, setDefaultHighWaterMark };
|
|
|
|
export { getDefaultHighWaterMark, setDefaultHighWaterMark };
|