Buckets:
| /*eslint-disable no-console*/ | |
| ; | |
| var protobuf = require("../../"), | |
| descriptor = require("."); | |
| /* var proto = { | |
| nested: { | |
| Message: { | |
| fields: { | |
| foo: { | |
| type: "string", | |
| id: 1 | |
| } | |
| }, | |
| nested: { | |
| SubMessage: { | |
| fields: {} | |
| } | |
| } | |
| }, | |
| Enum: { | |
| values: { | |
| ONE: 1, | |
| TWO: 2 | |
| } | |
| } | |
| } | |
| }; */ | |
| // var root = protobuf.Root.fromJSON(proto).resolveAll(); | |
| var root = protobuf.loadSync("tests/data/google/protobuf/descriptor.proto").resolveAll(); | |
| // console.log("Original proto", JSON.stringify(root, null, 2)); | |
| var msg = root.toDescriptor(); | |
| // console.log("\nDescriptor", JSON.stringify(msg.toObject(), null, 2)); | |
| var buf = descriptor.FileDescriptorSet.encode(msg).finish(); | |
| var root2 = protobuf.Root.fromDescriptor(buf, "proto2").resolveAll(); | |
| // console.log("\nDecoded proto", JSON.stringify(root2, null, 2)); | |
| var diff = require("deep-diff").diff(root.toJSON(), root2.toJSON()); | |
| if (diff) { | |
| diff.forEach(function(diff) { | |
| console.log(diff.kind + " @ " + diff.path.join(".")); | |
| console.log("lhs:", typeof diff.lhs, diff.lhs); | |
| console.log("rhs:", typeof diff.rhs, diff.rhs); | |
| console.log(); | |
| }); | |
| process.exitCode = 1; | |
| } else | |
| console.log("no differences"); | |
Xet Storage Details
- Size:
- 1.46 kB
- Xet hash:
- 503fbd3097dd9287e8f086c3ae7f061f06b83e52f50db5603493d35f0e5150f1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.