PHP 7.4.33
Preview: line-stream.js Size: 749 B
/var/www/sitesecurity.bitkit.dk/httpdocs/node_modules/m3u8-parser/src/line-stream.js
/**
 * @file m3u8/line-stream.js
 */
import Stream from '@videojs/vhs-utils/es/stream.js';

/**
 * A stream that buffers string input and generates a `data` event for each
 * line.
 *
 * @class LineStream
 * @extends Stream
 */
export default class LineStream extends Stream {
  constructor() {
    super();
    this.buffer = '';
  }

  /**
   * Add new data to be parsed.
   *
   * @param {string} data the text to process
   */
  push(data) {
    let nextNewline;

    this.buffer += data;
    nextNewline = this.buffer.indexOf('\n');

    for (; nextNewline > -1; nextNewline = this.buffer.indexOf('\n')) {
      this.trigger('data', this.buffer.substring(0, nextNewline));
      this.buffer = this.buffer.substring(nextNewline + 1);
    }
  }
}

Directory Contents

Dirs: 0 × Files: 4
Name Size Perms Modified Actions
540 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
749 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
21.39 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
37.81 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).