@bufbuild/protobuf
Advanced tools
@@ -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 @@ } |
@@ -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. |
+1
-1
| { | ||
| "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.", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1570846
0.05%41060
0.03%74
-1.33%