PHP 8.2.30
Preview: state.js Size: 749 B
//lib/node_modules/npm/node_modules/readable-stream/lib/internal/streams/state.js

'use strict';

var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;

function highWaterMarkFrom(options, isDuplex, duplexKey) {
  return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
}

function getHighWaterMark(state, options, duplexKey, isDuplex) {
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);

  if (hwm != null) {
    if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
      var name = isDuplex ? duplexKey : 'highWaterMark';
      throw new ERR_INVALID_OPT_VALUE(name, hwm);
    }

    return Math.floor(hwm);
  } // Default value


  return state.objectMode ? 16 : 16 * 1024;
}

module.exports = {
  getHighWaterMark: getHighWaterMark
};

Directory Contents

Dirs: 0 × Files: 10

Name Size Perms Modified Actions
5.82 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
6.19 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
3.04 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
3.03 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
101 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
3.06 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
2.37 KB lrw-r--r-- 2021-03-10 14:36:39
Edit Download
749 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
49 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download
36 B lrw-r--r-- 2021-03-10 14:36:39
Edit Download

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