PHP 8.2.30
Preview: state.js Size: 901 B
/opt/alt/alt-nodejs19/root/lib/node_modules/npm/node_modules/readable-stream/lib/internal/streams/state.js

'use strict'

const { MathFloor, NumberIsInteger } = require('../../ours/primordials')
const { ERR_INVALID_ARG_VALUE } = require('../../ours/errors').codes
function highWaterMarkFrom(options, isDuplex, duplexKey) {
  return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null
}
function getDefaultHighWaterMark(objectMode) {
  return objectMode ? 16 : 16 * 1024
}
function getHighWaterMark(state, options, duplexKey, isDuplex) {
  const hwm = highWaterMarkFrom(options, isDuplex, duplexKey)
  if (hwm != null) {
    if (!NumberIsInteger(hwm) || hwm < 0) {
      const name = isDuplex ? `options.${duplexKey}` : 'options.highWaterMark'
      throw new ERR_INVALID_ARG_VALUE(name, hwm)
    }
    return MathFloor(hwm)
  }

  // Default value
  return getDefaultHighWaterMark(state.objectMode)
}
module.exports = {
  getHighWaterMark,
  getDefaultHighWaterMark
}

Directory Contents

Dirs: 0 × Files: 18

Name Size Perms Modified Actions
1.32 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
3.77 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
3.31 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
6.61 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
4.73 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
8.89 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
6.70 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
2.54 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
1.54 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
2.83 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
11.57 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
1.71 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
10.23 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
39.85 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
901 B lrw-r--r-- 2023-12-06 18:07:52
Edit Download
6.93 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
9.81 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download
25.31 KB lrw-r--r-- 2023-12-06 18:07:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).