(state, options, duplexKey, isDuplex)
| 31 | } |
| 32 | |
| 33 | function getHighWaterMark(state, options, duplexKey, isDuplex) { |
| 34 | const hwm = highWaterMarkFrom(options, isDuplex, duplexKey); |
| 35 | if (hwm != null) { |
| 36 | if (!NumberIsInteger(hwm) || hwm < 0) { |
| 37 | const name = isDuplex ? `options.${duplexKey}` : 'options.highWaterMark'; |
| 38 | throw new ERR_INVALID_ARG_VALUE(name, hwm); |
| 39 | } |
| 40 | return MathFloor(hwm); |
| 41 | } |
| 42 | |
| 43 | // Default value |
| 44 | return getDefaultHighWaterMark(state.objectMode); |
| 45 | } |
| 46 | |
| 47 | module.exports = { |
| 48 | getHighWaterMark, |
no test coverage detected
searching dependent graphs…