Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@protobuf-ts/runtime

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@protobuf-ts/runtime - npm Package Compare versions

Comparing version 1.0.0-alpha.18 to 1.0.0-alpha.19

16

build/commonjs/binary-format-contract.d.ts

@@ -6,10 +6,22 @@ import { PbLong, PbULong } from "./pb-long";

export interface BinaryWriteOptions {
/**
* Allows to use a custom implementation to encode binary data.
*/
binaryWriterFactory: () => IBinaryWriter;
}
/**
* Options for parsing binary data.
* Options for reading binary data.
*/
export interface BinaryReadOptions {
/**
* When an unknown field is encountered while reading a message from
* binary format, an error is raised.
*
* Setting this option to `true` ignores unknown fields.
*/
ignoreUnknownFields: boolean;
/**
* Allows to use a custom implementation to parse binary data.
*/
binaryReaderFactory: (bytes: Uint8Array) => IBinaryReader;
ignoreUnknownFields: boolean;
}

@@ -16,0 +28,0 @@ /**

16

build/commonjs/message-type-contract.d.ts

@@ -6,4 +6,4 @@ import { FieldInfo } from "./reflection-info";

/**
* A partial message, where fields can be omitted,
* but oneof groups must remain intact.
* Similar to `Partial<T>`, but recursive, and keeps `oneof` groups
* intact.
*/

@@ -44,2 +44,4 @@ export declare type PartialMessage<T extends object> = {

* Create a new message with default values.
*
* For example, a protobuf `string name = 1;` has the default value `""`.
*/

@@ -49,2 +51,6 @@ create(): T;

* Create a new message from partial data.
*
* `PartialMessage<T>` is similar to `Partial<T>`,
* but it is recursive, and it keeps `oneof` groups
* intact.
*/

@@ -66,2 +72,3 @@ create(value: PartialMessage<T>): T;

* Read a new message from a JSON string.
* This is equivalent to `T.fromJson(JSON.parse(json))`.
*/

@@ -75,2 +82,3 @@ fromJsonString(json: string, options?: Partial<JsonReadOptions>): T;

* Convert the message to canonical JSON string.
* This is equivalent to `JSON.stringify(T.toJson(t))`
*/

@@ -88,3 +96,3 @@ toJsonString(message: T, options?: Partial<JsonWriteStringOptions>): string;

* Is the given value assignable to our message type
* and contains no excess properties?
* and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -94,3 +102,3 @@ is(arg: any, depth?: number): arg is T;

* Is the given value assignable to our message type,
* regardless of excess properties?
* regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -97,0 +105,0 @@ isAssignable(arg: any, depth?: number): arg is T;

@@ -27,2 +27,4 @@ import { IMessageType, PartialMessage } from "./message-type-contract";

* Create a new message with default values.
*
* For example, a protobuf `string name = 1;` has the default value `""`.
*/

@@ -32,2 +34,6 @@ create(): T;

* Create a new message from partial data.
* Where a field is omitted, the default value is used.
* `PartialMessage<T>` is similar to `Partial<T>`,
* but it is recursive, and it keeps `oneof` groups
* intact.
*/

@@ -41,3 +47,3 @@ create(value: PartialMessage<T>): T;

* Is the given value assignable to our message type
* and contains no excess properties?
* and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -47,3 +53,3 @@ is(arg: any, depth?: number): arg is T;

* Is the given value assignable to our message type,
* regardless of excess properties?
* regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -67,2 +73,3 @@ isAssignable(arg: any, depth?: number): arg is T;

* Read a new message from a JSON string.
* This is equivalent to `T.fromJson(JSON.parse(json))`.
*/

@@ -76,2 +83,3 @@ fromJsonString(json: string, options?: Partial<JsonReadOptions>): T;

* Convert the message to canonical JSON string.
* This is equivalent to `JSON.stringify(T.toJson(t))`
*/

@@ -78,0 +86,0 @@ toJsonString(message: T, options?: Partial<JsonWriteStringOptions>): string;

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

* Is the given value assignable to our message type
* and contains no excess properties?
* and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -55,3 +55,3 @@ is(arg, depth = this.defaultCheckDepth) {

* Is the given value assignable to our message type,
* regardless of excess properties?
* regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -84,2 +84,3 @@ isAssignable(arg, depth = this.defaultCheckDepth) {

* Read a new message from a JSON string.
* This is equivalent to `T.fromJson(JSON.parse(json))`.
*/

@@ -98,2 +99,3 @@ fromJsonString(json, options) {

* Convert the message to canonical JSON string.
* This is equivalent to `JSON.stringify(T.toJson(t))`
*/

@@ -100,0 +102,0 @@ toJsonString(message, options) {

@@ -294,3 +294,3 @@ import { IMessageType } from "./message-type-contract";

*
* You can change the default behaviour by enabling the plugin option
* You can change the default behaviour by enabling the plugin parameter
* `long_type_string`, which will represent 64 bit types as `string`.

@@ -297,0 +297,0 @@ *

@@ -6,10 +6,22 @@ import { PbLong, PbULong } from "./pb-long";

export interface BinaryWriteOptions {
/**
* Allows to use a custom implementation to encode binary data.
*/
binaryWriterFactory: () => IBinaryWriter;
}
/**
* Options for parsing binary data.
* Options for reading binary data.
*/
export interface BinaryReadOptions {
/**
* When an unknown field is encountered while reading a message from
* binary format, an error is raised.
*
* Setting this option to `true` ignores unknown fields.
*/
ignoreUnknownFields: boolean;
/**
* Allows to use a custom implementation to parse binary data.
*/
binaryReaderFactory: (bytes: Uint8Array) => IBinaryReader;
ignoreUnknownFields: boolean;
}

@@ -16,0 +28,0 @@ /**

@@ -6,4 +6,4 @@ import { FieldInfo } from "./reflection-info";

/**
* A partial message, where fields can be omitted,
* but oneof groups must remain intact.
* Similar to `Partial<T>`, but recursive, and keeps `oneof` groups
* intact.
*/

@@ -44,2 +44,4 @@ export declare type PartialMessage<T extends object> = {

* Create a new message with default values.
*
* For example, a protobuf `string name = 1;` has the default value `""`.
*/

@@ -49,2 +51,6 @@ create(): T;

* Create a new message from partial data.
*
* `PartialMessage<T>` is similar to `Partial<T>`,
* but it is recursive, and it keeps `oneof` groups
* intact.
*/

@@ -66,2 +72,3 @@ create(value: PartialMessage<T>): T;

* Read a new message from a JSON string.
* This is equivalent to `T.fromJson(JSON.parse(json))`.
*/

@@ -75,2 +82,3 @@ fromJsonString(json: string, options?: Partial<JsonReadOptions>): T;

* Convert the message to canonical JSON string.
* This is equivalent to `JSON.stringify(T.toJson(t))`
*/

@@ -88,3 +96,3 @@ toJsonString(message: T, options?: Partial<JsonWriteStringOptions>): string;

* Is the given value assignable to our message type
* and contains no excess properties?
* and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -94,3 +102,3 @@ is(arg: any, depth?: number): arg is T;

* Is the given value assignable to our message type,
* regardless of excess properties?
* regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -97,0 +105,0 @@ isAssignable(arg: any, depth?: number): arg is T;

@@ -27,2 +27,4 @@ import { IMessageType, PartialMessage } from "./message-type-contract";

* Create a new message with default values.
*
* For example, a protobuf `string name = 1;` has the default value `""`.
*/

@@ -32,2 +34,6 @@ create(): T;

* Create a new message from partial data.
* Where a field is omitted, the default value is used.
* `PartialMessage<T>` is similar to `Partial<T>`,
* but it is recursive, and it keeps `oneof` groups
* intact.
*/

@@ -41,3 +47,3 @@ create(value: PartialMessage<T>): T;

* Is the given value assignable to our message type
* and contains no excess properties?
* and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -47,3 +53,3 @@ is(arg: any, depth?: number): arg is T;

* Is the given value assignable to our message type,
* regardless of excess properties?
* regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -67,2 +73,3 @@ isAssignable(arg: any, depth?: number): arg is T;

* Read a new message from a JSON string.
* This is equivalent to `T.fromJson(JSON.parse(json))`.
*/

@@ -76,2 +83,3 @@ fromJsonString(json: string, options?: Partial<JsonReadOptions>): T;

* Convert the message to canonical JSON string.
* This is equivalent to `JSON.stringify(T.toJson(t))`
*/

@@ -78,0 +86,0 @@ toJsonString(message: T, options?: Partial<JsonWriteStringOptions>): string;

@@ -44,3 +44,3 @@ import { normalizeFieldInfo } from "./reflection-info";

* Is the given value assignable to our message type
* and contains no excess properties?
* and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -52,3 +52,3 @@ is(arg, depth = this.defaultCheckDepth) {

* Is the given value assignable to our message type,
* regardless of excess properties?
* regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/

@@ -81,2 +81,3 @@ isAssignable(arg, depth = this.defaultCheckDepth) {

* Read a new message from a JSON string.
* This is equivalent to `T.fromJson(JSON.parse(json))`.
*/

@@ -95,2 +96,3 @@ fromJsonString(json, options) {

* Convert the message to canonical JSON string.
* This is equivalent to `JSON.stringify(T.toJson(t))`
*/

@@ -97,0 +99,0 @@ toJsonString(message, options) {

@@ -294,3 +294,3 @@ import { IMessageType } from "./message-type-contract";

*
* You can change the default behaviour by enabling the plugin option
* You can change the default behaviour by enabling the plugin parameter
* `long_type_string`, which will represent 64 bit types as `string`.

@@ -297,0 +297,0 @@ *

{
"name": "@protobuf-ts/runtime",
"version": "1.0.0-alpha.18",
"version": "1.0.0-alpha.19",
"description": "Runtime library for code generated by the protobuf-ts plugin",

@@ -38,3 +38,3 @@ "license": "Apache-2.0",

},
"gitHead": "85e39eb0777c437d601c1d6ef379a9906a5e3f3e"
"gitHead": "3d1c5376be1ba69e57a8b13e12e0a5df2d300ef2"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc