protobufjs-cli
Advanced tools
+16
-0
| # Changelog | ||
| ## [2.4.2](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v2.4.1...protobufjs-cli-v2.4.2) (2026-05-22) | ||
| ### Bug Fixes | ||
| * Align reserved range semantics ([#2277](https://github.com/protobufjs/protobuf.js/issues/2277)) ([48aa10f](https://github.com/protobufjs/protobuf.js/commit/48aa10f642bde16b6061463cd9ee9fa6f495532f)) | ||
| ### Dependencies | ||
| * The following workspace dependencies were updated | ||
| * devDependencies | ||
| * protobufjs bumped from file:.. to 8.4.2 | ||
| * peerDependencies | ||
| * protobufjs bumped from ^8.4.1 to ^8.4.2 | ||
| ## [2.4.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v2.4.0...protobufjs-cli-v2.4.1) (2026-05-21) | ||
@@ -4,0 +20,0 @@ |
+2
-2
| { | ||
| "name": "protobufjs-cli", | ||
| "description": "Translates between file formats and generates static code as well as TypeScript definitions.", | ||
| "version": "2.4.1", | ||
| "version": "2.4.2", | ||
| "author": "Daniel Wirtz <dcode+protobufjs@dcode.io>", | ||
@@ -23,3 +23,3 @@ "repository": { | ||
| "peerDependencies": { | ||
| "protobufjs": "^8.4.1" | ||
| "protobufjs": "^8.4.2" | ||
| }, | ||
@@ -26,0 +26,0 @@ "dependencies": { |
+13
-5
@@ -28,2 +28,4 @@ "use strict"; | ||
| var syntax = 3; | ||
| var maxFieldId = 0x1FFFFFFF; // 2^29 - 1 | ||
| var maxEnumId = 0x7FFFFFFF; // 2^31 - 1 | ||
@@ -150,2 +152,3 @@ function proto_target(root, options, callback) { | ||
| }); | ||
| buildRanges("reserved", enm.reserved, maxEnumId); | ||
| --indent; first = false; | ||
@@ -155,15 +158,20 @@ push("}"); | ||
| function buildRanges(keyword, ranges) { | ||
| function buildRanges(keyword, ranges, max) { | ||
| max = max || maxFieldId; | ||
| if (ranges && ranges.length) { | ||
| var parts = []; | ||
| var parts = [], | ||
| names = []; | ||
| ranges.forEach(function(range) { | ||
| if (typeof range === "string") | ||
| parts.push("\"" + escape(range) + "\""); | ||
| names.push("\"" + escape(range) + "\""); | ||
| else if (range[0] === range[1]) | ||
| parts.push(range[0]); | ||
| else | ||
| parts.push(range[0] + " to " + (range[1] === 0x1FFFFFFF ? "max" : range[1])); | ||
| parts.push(range[0] + " to " + (range[1] === max ? "max" : range[1])); | ||
| }); | ||
| push(""); | ||
| push(keyword + " " + parts.join(", ") + ";"); | ||
| if (parts.length) | ||
| push(keyword + " " + parts.join(", ") + ";"); | ||
| if (names.length) | ||
| push(keyword + " " + names.join(", ") + ";"); | ||
| } | ||
@@ -170,0 +178,0 @@ } |
156690
0.54%3441
0.23%