@bufbuild/protobuf
Advanced tools
Comparing version 1.9.0 to 1.10.0
@@ -64,3 +64,3 @@ /** | ||
*/ | ||
skip(wireType: WireType): Uint8Array; | ||
skip(wireType: WireType, fieldNo?: number): Uint8Array; | ||
/** | ||
@@ -351,6 +351,8 @@ * Read a `uint32` field, an unsigned 32 bit varint. | ||
/** | ||
* Skip one element on the wire and return the skipped data. | ||
* Supports WireType.StartGroup since v2.0.0-alpha.23. | ||
* Skip one element and return the skipped data. | ||
* | ||
* When skipping StartGroup, provide the tags field number to check for | ||
* matching field number in the EndGroup tag. | ||
*/ | ||
skip(wireType: WireType): Uint8Array; | ||
skip(wireType: WireType, fieldNo?: number): Uint8Array; | ||
protected varint64: () => [number, number]; | ||
@@ -357,0 +359,0 @@ /** |
@@ -297,6 +297,8 @@ "use strict"; | ||
/** | ||
* Skip one element on the wire and return the skipped data. | ||
* Supports WireType.StartGroup since v2.0.0-alpha.23. | ||
* Skip one element and return the skipped data. | ||
* | ||
* When skipping StartGroup, provide the tags field number to check for | ||
* matching field number in the EndGroup tag. | ||
*/ | ||
skip(wireType) { | ||
skip(wireType, fieldNo) { | ||
let start = this.pos; | ||
@@ -323,6 +325,11 @@ switch (wireType) { | ||
case WireType.StartGroup: | ||
// TODO check for matching field numbers in StartGroup / EndGroup tags | ||
let t; | ||
while ((t = this.tag()[1]) !== WireType.EndGroup) { | ||
this.skip(t); | ||
for (;;) { | ||
const [fn, wt] = this.tag(); | ||
if (wt === WireType.EndGroup) { | ||
if (fieldNo !== undefined && fn !== fieldNo) { | ||
throw new Error("invalid end group tag"); | ||
} | ||
break; | ||
} | ||
this.skip(wt, fn); | ||
} | ||
@@ -329,0 +336,0 @@ break; |
@@ -77,3 +77,3 @@ "use strict"; | ||
const [no, wireType] = reader.tag(); | ||
const data = reader.skip(wireType); | ||
const data = reader.skip(wireType, no); | ||
message.getType().runtime.bin.onUnknownField(message, no, wireType, data); | ||
@@ -80,0 +80,0 @@ } |
@@ -17,3 +17,3 @@ "use strict"; | ||
exports.ListValue = exports.Value = exports.Struct = exports.NullValue = void 0; | ||
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" | ||
// @generated by protoc-gen-es v1.10.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" | ||
// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3) | ||
@@ -20,0 +20,0 @@ /* eslint-disable */ |
@@ -17,3 +17,3 @@ "use strict"; | ||
exports.Option = exports.EnumValue = exports.Enum = exports.Field_Cardinality = exports.Field_Kind = exports.Field = exports.Type = exports.Syntax = void 0; | ||
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" | ||
// @generated by protoc-gen-es v1.10.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" | ||
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3) | ||
@@ -20,0 +20,0 @@ /* eslint-disable */ |
@@ -78,3 +78,4 @@ "use strict"; | ||
[fieldNo, wireType] = reader.tag(); | ||
if (wireType == binary_encoding_js_1.WireType.EndGroup) { | ||
if (delimitedMessageEncoding === true && | ||
wireType == binary_encoding_js_1.WireType.EndGroup) { | ||
break; | ||
@@ -84,3 +85,3 @@ } | ||
if (!field) { | ||
const data = reader.skip(wireType); | ||
const data = reader.skip(wireType, fieldNo); | ||
if (options.readUnknownFields) { | ||
@@ -87,0 +88,0 @@ this.onUnknownField(message, fieldNo, wireType, data); |
@@ -24,3 +24,3 @@ "use strict"; | ||
return descriptor_pb_js_1.FeatureSetDefaults.fromBinary(proto_base64_js_1.protoBase64.dec( | ||
/*upstream-inject-feature-defaults-start*/ "ChESDAgBEAIYAiADKAEwAhjmBwoREgwIAhABGAEgAigBMAEY5wcKERIMCAEQARgBIAIoATABGOgHIOYHKOgH" /*upstream-inject-feature-defaults-end*/), options); | ||
/*upstream-inject-feature-defaults-start*/ "ChMY5gciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH" /*upstream-inject-feature-defaults-end*/), options); | ||
} | ||
@@ -32,3 +32,3 @@ /** | ||
function createFeatureResolver(edition, compiledFeatureSetDefaults, serializationOptions) { | ||
var _a, _b; | ||
var _a; | ||
const fds = compiledFeatureSetDefaults !== null && compiledFeatureSetDefaults !== void 0 ? compiledFeatureSetDefaults : getFeatureSetDefaults(serializationOptions); | ||
@@ -57,5 +57,19 @@ const min = fds.minimumEdition; | ||
} | ||
let f; | ||
if (c.fixedFeatures && c.overridableFeatures) { | ||
f = c.fixedFeatures; | ||
f.fromBinary(c.overridableFeatures.toBinary()); | ||
} | ||
else if (c.fixedFeatures) { | ||
f = c.fixedFeatures; | ||
} | ||
else if (c.overridableFeatures) { | ||
f = c.overridableFeatures; | ||
} | ||
else { | ||
f = new descriptor_pb_js_1.FeatureSet(); | ||
} | ||
highestMatch = { | ||
e, | ||
f: (_b = c.features) !== null && _b !== void 0 ? _b : new descriptor_pb_js_1.FeatureSet(), | ||
f, | ||
}; | ||
@@ -62,0 +76,0 @@ } |
@@ -32,3 +32,3 @@ "use strict"; | ||
const localName = member.localName, t = target, s = source; | ||
if (s[localName] === undefined) { | ||
if (s[localName] == null) { | ||
// TODO if source is a Message instance, we should use isFieldSet() here to support future field presence | ||
@@ -35,0 +35,0 @@ continue; |
@@ -64,3 +64,3 @@ /** | ||
*/ | ||
skip(wireType: WireType): Uint8Array; | ||
skip(wireType: WireType, fieldNo?: number): Uint8Array; | ||
/** | ||
@@ -351,6 +351,8 @@ * Read a `uint32` field, an unsigned 32 bit varint. | ||
/** | ||
* Skip one element on the wire and return the skipped data. | ||
* Supports WireType.StartGroup since v2.0.0-alpha.23. | ||
* Skip one element and return the skipped data. | ||
* | ||
* When skipping StartGroup, provide the tags field number to check for | ||
* matching field number in the EndGroup tag. | ||
*/ | ||
skip(wireType: WireType): Uint8Array; | ||
skip(wireType: WireType, fieldNo?: number): Uint8Array; | ||
protected varint64: () => [number, number]; | ||
@@ -357,0 +359,0 @@ /** |
@@ -293,6 +293,8 @@ // Copyright 2021-2024 Buf Technologies, Inc. | ||
/** | ||
* Skip one element on the wire and return the skipped data. | ||
* Supports WireType.StartGroup since v2.0.0-alpha.23. | ||
* Skip one element and return the skipped data. | ||
* | ||
* When skipping StartGroup, provide the tags field number to check for | ||
* matching field number in the EndGroup tag. | ||
*/ | ||
skip(wireType) { | ||
skip(wireType, fieldNo) { | ||
let start = this.pos; | ||
@@ -319,6 +321,11 @@ switch (wireType) { | ||
case WireType.StartGroup: | ||
// TODO check for matching field numbers in StartGroup / EndGroup tags | ||
let t; | ||
while ((t = this.tag()[1]) !== WireType.EndGroup) { | ||
this.skip(t); | ||
for (;;) { | ||
const [fn, wt] = this.tag(); | ||
if (wt === WireType.EndGroup) { | ||
if (fieldNo !== undefined && fn !== fieldNo) { | ||
throw new Error("invalid end group tag"); | ||
} | ||
break; | ||
} | ||
this.skip(wt, fn); | ||
} | ||
@@ -325,0 +332,0 @@ break; |
@@ -73,3 +73,3 @@ // Copyright 2021-2024 Buf Technologies, Inc. | ||
const [no, wireType] = reader.tag(); | ||
const data = reader.skip(wireType); | ||
const data = reader.skip(wireType, no); | ||
message.getType().runtime.bin.onUnknownField(message, no, wireType, data); | ||
@@ -76,0 +76,0 @@ } |
@@ -14,3 +14,3 @@ // Copyright 2021-2024 Buf Technologies, Inc. | ||
// limitations under the License. | ||
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" | ||
// @generated by protoc-gen-es v1.10.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" | ||
// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3) | ||
@@ -17,0 +17,0 @@ /* eslint-disable */ |
@@ -14,3 +14,3 @@ // Copyright 2021-2024 Buf Technologies, Inc. | ||
// limitations under the License. | ||
// @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" | ||
// @generated by protoc-gen-es v1.10.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" | ||
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3) | ||
@@ -17,0 +17,0 @@ /* eslint-disable */ |
@@ -76,3 +76,4 @@ // Copyright 2021-2024 Buf Technologies, Inc. | ||
[fieldNo, wireType] = reader.tag(); | ||
if (wireType == WireType.EndGroup) { | ||
if (delimitedMessageEncoding === true && | ||
wireType == WireType.EndGroup) { | ||
break; | ||
@@ -82,3 +83,3 @@ } | ||
if (!field) { | ||
const data = reader.skip(wireType); | ||
const data = reader.skip(wireType, fieldNo); | ||
if (options.readUnknownFields) { | ||
@@ -85,0 +86,0 @@ this.onUnknownField(message, fieldNo, wireType, data); |
@@ -21,3 +21,3 @@ // Copyright 2021-2024 Buf Technologies, Inc. | ||
return FeatureSetDefaults.fromBinary(protoBase64.dec( | ||
/*upstream-inject-feature-defaults-start*/ "ChESDAgBEAIYAiADKAEwAhjmBwoREgwIAhABGAEgAigBMAEY5wcKERIMCAEQARgBIAIoATABGOgHIOYHKOgH" /*upstream-inject-feature-defaults-end*/), options); | ||
/*upstream-inject-feature-defaults-start*/ "ChMY5gciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH" /*upstream-inject-feature-defaults-end*/), options); | ||
} | ||
@@ -29,3 +29,3 @@ /** | ||
export function createFeatureResolver(edition, compiledFeatureSetDefaults, serializationOptions) { | ||
var _a, _b; | ||
var _a; | ||
const fds = compiledFeatureSetDefaults !== null && compiledFeatureSetDefaults !== void 0 ? compiledFeatureSetDefaults : getFeatureSetDefaults(serializationOptions); | ||
@@ -54,5 +54,19 @@ const min = fds.minimumEdition; | ||
} | ||
let f; | ||
if (c.fixedFeatures && c.overridableFeatures) { | ||
f = c.fixedFeatures; | ||
f.fromBinary(c.overridableFeatures.toBinary()); | ||
} | ||
else if (c.fixedFeatures) { | ||
f = c.fixedFeatures; | ||
} | ||
else if (c.overridableFeatures) { | ||
f = c.overridableFeatures; | ||
} | ||
else { | ||
f = new FeatureSet(); | ||
} | ||
highestMatch = { | ||
e, | ||
f: (_b = c.features) !== null && _b !== void 0 ? _b : new FeatureSet(), | ||
f, | ||
}; | ||
@@ -59,0 +73,0 @@ } |
@@ -30,3 +30,3 @@ // Copyright 2021-2024 Buf Technologies, Inc. | ||
const localName = member.localName, t = target, s = source; | ||
if (s[localName] === undefined) { | ||
if (s[localName] == null) { | ||
// TODO if source is a Message instance, we should use isFieldSet() here to support future field presence | ||
@@ -33,0 +33,0 @@ continue; |
{ | ||
"name": "@bufbuild/protobuf", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"license": "(Apache-2.0 AND BSD-3-Clause)", | ||
@@ -33,6 +33,3 @@ "description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.", | ||
"upstream-protobuf": "*" | ||
}, | ||
"files": [ | ||
"dist/**" | ||
] | ||
} | ||
} |
@@ -18,3 +18,3 @@ # @bufbuild/protobuf | ||
- Generation of idiomatic JavaScript and TypeScript code. | ||
- Generation of [much smaller bundles](https://github.com/bufbuild/protobuf-es/blob/main/packages/protobuf-bench) | ||
- Generation of [much smaller bundles](https://github.com/bufbuild/protobuf-es/blob/main/packages/bundle-size) | ||
- Implementation of all proto3 features, including the [canonical JSON format](https://developers.google.com/protocol-buffers/docs/proto3#json). | ||
@@ -21,0 +21,0 @@ - Implementation of all proto2 features, except for extensions and the text format. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1448735
36972
53
3
4
2
22