Server IP : 92.205.26.207 / Your IP : 216.73.216.16 Web Server : Apache System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64 User : zikryat ( 1002) PHP Version : 8.3.23 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/zikryat/public_html/node_modules/protobufjs-cli/targets/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
"use strict"; module.exports = json_module; var util = require("../util"); var protobuf = require("protobufjs"); json_module.description = "JSON representation as a module"; function jsonSafeProp(json) { return json.replace(/^( +)"(\w+)":/mg, function($0, $1, $2) { return protobuf.util.safeProp($2).charAt(0) === "." ? $1 + $2 + ":" : $0; }); } function json_module(root, options, callback) { try { var rootProp = protobuf.util.safeProp(options.root || "default"); var output = [ (options.es6 ? "const" : "var") + " $root = ($protobuf.roots" + rootProp + " || ($protobuf.roots" + rootProp + " = new $protobuf.Root()))\n" ]; if (root.options) { var optionsJson = jsonSafeProp(JSON.stringify(root.options, null, 2)); output.push(".setOptions(" + optionsJson + ")\n"); } var json = jsonSafeProp(JSON.stringify(root.nested, null, 2).trim()); output.push(".addJSON(" + json + ");"); output = util.wrap(output.join(""), protobuf.util.merge({ dependency: "protobufjs/light" }, options)); process.nextTick(function() { callback(null, output); }); } catch (e) { return callback(e); } return undefined; }