PHP 8.2.30
Preview: json_parser.js Size: 650 B
/home/byroehnu/.trash/node_modules11/formidable/lib/json_parser.js

if (global.GENTLY) require = GENTLY.hijack(require);

var Buffer = require('buffer').Buffer;

function JSONParser(parent) {
  this.parent = parent;
  this.chunks = [];
  this.bytesWritten = 0;
}
exports.JSONParser = JSONParser;

JSONParser.prototype.write = function(buffer) {
  this.bytesWritten += buffer.length;
  this.chunks.push(buffer);
  return buffer.length;
};

JSONParser.prototype.end = function() {
  try {
    var fields = JSON.parse(Buffer.concat(this.chunks));
    for (var field in fields) {
      this.onField(field, fields[field]);
    }
  } catch (e) {
    this.parent.emit('error', e);
  }
  this.data = null;

  this.onEnd();
};

Directory Contents

Dirs: 0 × Files: 7

Name Size Perms Modified Actions
1.60 KB lrw-r--r-- 2026-02-28 11:54:48
Edit Download
13.54 KB lrw-r--r-- 2026-02-28 11:54:48
Edit Download
133 B lrw-r--r-- 2026-02-28 11:54:50
Edit Download
650 B lrw-r--r-- 2026-02-28 11:54:50
Edit Download
8.26 KB lrw-r--r-- 2026-02-28 11:54:50
Edit Download
456 B lrw-r--r-- 2026-02-28 11:54:50
Edit Download
740 B lrw-r--r-- 2026-02-28 11:54:50
Edit Download

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