You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@bufbuild/protobuf

Package Overview
Dependencies
Maintainers
7
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufbuild/protobuf - npm Package Compare versions

Comparing version
2.6.3
to
2.7.0
+8
-2
dist/cjs/from-binary.js

@@ -23,2 +23,3 @@ "use strict";

const binary_encoding_js_1 = require("./wire/binary-encoding.js");
const varint_js_1 = require("./wire/varint.js");
// Default options for parsing binary data.

@@ -110,5 +111,10 @@ const readDefaults = {

else if (options.readUnknownFields) {
const data = new binary_encoding_js_1.BinaryWriter().int32(val).finish();
const bytes = [];
(0, varint_js_1.varint32write)(val, bytes);
const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : [];
unknownFields.push({ no: field.number, wireType, data });
unknownFields.push({
no: field.number,
wireType,
data: new Uint8Array(bytes),
});
message.setUnknown(unknownFields);

@@ -115,0 +121,0 @@ }

+1
-1

@@ -20,3 +20,3 @@ import type { MessageShape } from "./types.js";

}
export declare function toBinary<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>, options?: Partial<BinaryWriteOptions>): Uint8Array;
export declare function toBinary<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>, options?: Partial<BinaryWriteOptions>): Uint8Array<ArrayBuffer>;
/**

@@ -23,0 +23,0 @@ * @private

@@ -12,3 +12,3 @@ /**

*/
export declare function base64Decode(base64Str: string): Uint8Array;
export declare function base64Decode(base64Str: string): Uint8Array<ArrayBuffer>;
/**

@@ -15,0 +15,0 @@ * Encode a byte array to a base64 string.

@@ -45,3 +45,3 @@ "use strict";

switch (base64Str[i]) {
// @ts-expect-error TS7029: Fallthrough case in switch
// @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true
case "=":

@@ -48,0 +48,0 @@ groupPos = 0; // reset state when padding found

@@ -89,3 +89,3 @@ /**

*/
finish(): Uint8Array;
finish(): Uint8Array<ArrayBuffer>;
/**

@@ -92,0 +92,0 @@ * Start a new fork for length-delimited data like a message

@@ -332,3 +332,3 @@ "use strict";

break;
// @ts-expect-error TS7029: Fallthrough case in switch
// @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true
case WireType.Bit64:

@@ -335,0 +335,0 @@ this.pos += 4;

@@ -9,3 +9,3 @@ interface TextEncoding {

*/
encodeUtf8: (text: string) => Uint8Array;
encodeUtf8: (text: string) => Uint8Array<ArrayBuffer>;
/**

@@ -12,0 +12,0 @@ * Decode UTF-8 text from binary.

@@ -17,3 +17,4 @@ // Copyright 2021-2025 Buf Technologies, Inc.

import { reflect } from "./reflect/reflect.js";
import { BinaryReader, BinaryWriter, WireType, } from "./wire/binary-encoding.js";
import { BinaryReader, WireType } from "./wire/binary-encoding.js";
import { varint32write } from "./wire/varint.js";
// Default options for parsing binary data.

@@ -105,5 +106,10 @@ const readDefaults = {

else if (options.readUnknownFields) {
const data = new BinaryWriter().int32(val).finish();
const bytes = [];
varint32write(val, bytes);
const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : [];
unknownFields.push({ no: field.number, wireType, data });
unknownFields.push({
no: field.number,
wireType,
data: new Uint8Array(bytes),
});
message.setUnknown(unknownFields);

@@ -110,0 +116,0 @@ }

@@ -20,3 +20,3 @@ import type { MessageShape } from "./types.js";

}
export declare function toBinary<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>, options?: Partial<BinaryWriteOptions>): Uint8Array;
export declare function toBinary<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>, options?: Partial<BinaryWriteOptions>): Uint8Array<ArrayBuffer>;
/**

@@ -23,0 +23,0 @@ * @private

@@ -12,3 +12,3 @@ /**

*/
export declare function base64Decode(base64Str: string): Uint8Array;
export declare function base64Decode(base64Str: string): Uint8Array<ArrayBuffer>;
/**

@@ -15,0 +15,0 @@ * Encode a byte array to a base64 string.

@@ -41,3 +41,3 @@ // Copyright 2021-2025 Buf Technologies, Inc.

switch (base64Str[i]) {
// @ts-expect-error TS7029: Fallthrough case in switch
// @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true
case "=":

@@ -44,0 +44,0 @@ groupPos = 0; // reset state when padding found

@@ -89,3 +89,3 @@ /**

*/
finish(): Uint8Array;
finish(): Uint8Array<ArrayBuffer>;
/**

@@ -92,0 +92,0 @@ * Start a new fork for length-delimited data like a message

@@ -328,3 +328,3 @@ // Copyright 2021-2025 Buf Technologies, Inc.

break;
// @ts-expect-error TS7029: Fallthrough case in switch
// @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true
case WireType.Bit64:

@@ -331,0 +331,0 @@ this.pos += 4;

@@ -9,3 +9,3 @@ interface TextEncoding {

*/
encodeUtf8: (text: string) => Uint8Array;
encodeUtf8: (text: string) => Uint8Array<ArrayBuffer>;
/**

@@ -12,0 +12,0 @@ * Decode UTF-8 text from binary.

{
"name": "@bufbuild/protobuf",
"version": "2.6.3",
"version": "2.7.0",
"license": "(Apache-2.0 AND BSD-3-Clause)",

@@ -5,0 +5,0 @@ "description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.",