function flush_pending(strm) {
  let s = strm.state;
  //_tr_flush_bits(s);
  let len = s.pending;
  if (len > strm.avail_out) {
    len = strm.avail_out;
  }
  if (len === 0) return;
  strm.output.set(
    s.pending_buf.subarray(s.pending_out, s.pending_out + len),
    strm.next_out,
  );
  strm.next_out += len;
  s.pending_out += len;
  strm.total_out += len;
  strm.avail_out -= len;
  s.pending -= len;
  if (s.pending === 0) {
    s.pending_out = 0;
  }
}
/* =========================================================================
 * Flush as much pending output as possible. All deflate() output goes
 * through this function so some applications may wish to modify it
 * to avoid allocating a large strm->output buffer and copying into it.
 * (See also read_buf()).
 */
Flush as much pending output as possible. All deflate() output goes
through this function so some applications may wish to modify it
to avoid allocating a large strm->output buffer and copying into it.
Flush as much pending output as possible . All deflate () output goes through this function so some applications may wish to modify it to avoid allocating a large strm - > output buffer and copying into it .
function flush_pending(strm) {
  let s = strm.state;
  let len = s.pending;
  if (len > strm.avail_out) {
    len = strm.avail_out;
  }
  if (len === 0) return;
  strm.output.set(
    s.pending_buf.subarray(s.pending_out, s.pending_out + len),
    strm.next_out,
  );
  strm.next_out += len;
  s.pending_out += len;
  strm.total_out += len;
  strm.avail_out -= len;
  s.pending -= len;
  if (s.pending === 0) {
    s.pending_out = 0;
  }
}
function flush_pending ( strm ) { let s = strm . state ; let len = s . pending ; if ( len > strm . avail_out ) { len = strm . avail_out ; } if ( len === 0 ) return ; strm . output . set ( s . pending_buf . subarray ( s . pending_out , s . pending_out + len ) , strm . next_out , ) ; strm . next_out += len ; s . pending_out += len ; strm . total_out += len ; strm . avail_out -= len ; s . pending -= len ; if ( s . pending === 0 ) { s . pending_out = 0 ; } }
Flush as much pending output as possible.
Flush as much pending output as possible .
//_tr_flush_bits(s);