@protobuf-ts/runtime
Advanced tools
Comparing version 2.0.3 to 2.0.4-alpha.0
@@ -97,3 +97,3 @@ "use strict"; | ||
* Used for fixed64, sfixed64, double. | ||
* Always 8 bytes. | ||
* Always 8 bytes with little-endian byte order. | ||
*/ | ||
@@ -121,5 +121,5 @@ WireType[WireType["Bit64"] = 1] = "Bit64"; | ||
* Used for fixed32, sfixed32, float. | ||
* Always 4 bytes. | ||
* Always 4 bytes with little-endian byte order. | ||
*/ | ||
WireType[WireType["Bit32"] = 5] = "Bit32"; | ||
})(WireType = exports.WireType || (exports.WireType = {})); |
@@ -63,3 +63,3 @@ "use strict"; | ||
this.assertBounds(); | ||
return this.buf.slice(start, this.pos); | ||
return this.buf.subarray(start, this.pos); | ||
} | ||
@@ -161,3 +161,3 @@ /** | ||
this.assertBounds(); | ||
return this.buf.slice(start, this.pos); | ||
return this.buf.subarray(start, start + len); | ||
} | ||
@@ -164,0 +164,0 @@ /** |
@@ -10,7 +10,6 @@ "use strict"; | ||
*/ | ||
function reflectionCreate(info) { | ||
let msg = { | ||
[message_type_contract_1.MESSAGE_TYPE]: info, | ||
}; | ||
for (let field of info.fields) { | ||
function reflectionCreate(type) { | ||
const msg = {}; | ||
Object.defineProperty(msg, message_type_contract_1.MESSAGE_TYPE, { enumerable: false, value: type }); | ||
for (let field of type.fields) { | ||
let name = field.localName; | ||
@@ -17,0 +16,0 @@ if (field.opt) |
@@ -91,3 +91,3 @@ import { BinaryReader } from "./binary-reader"; | ||
* Used for fixed64, sfixed64, double. | ||
* Always 8 bytes. | ||
* Always 8 bytes with little-endian byte order. | ||
*/ | ||
@@ -115,5 +115,5 @@ WireType[WireType["Bit64"] = 1] = "Bit64"; | ||
* Used for fixed32, sfixed32, float. | ||
* Always 4 bytes. | ||
* Always 4 bytes with little-endian byte order. | ||
*/ | ||
WireType[WireType["Bit32"] = 5] = "Bit32"; | ||
})(WireType || (WireType = {})); |
@@ -60,3 +60,3 @@ import { WireType } from "./binary-format-contract"; | ||
this.assertBounds(); | ||
return this.buf.slice(start, this.pos); | ||
return this.buf.subarray(start, this.pos); | ||
} | ||
@@ -158,3 +158,3 @@ /** | ||
this.assertBounds(); | ||
return this.buf.slice(start, this.pos); | ||
return this.buf.subarray(start, start + len); | ||
} | ||
@@ -161,0 +161,0 @@ /** |
@@ -7,7 +7,6 @@ import { reflectionScalarDefault } from "./reflection-scalar-default"; | ||
*/ | ||
export function reflectionCreate(info) { | ||
let msg = { | ||
[MESSAGE_TYPE]: info, | ||
}; | ||
for (let field of info.fields) { | ||
export function reflectionCreate(type) { | ||
const msg = {}; | ||
Object.defineProperty(msg, MESSAGE_TYPE, { enumerable: false, value: type }); | ||
for (let field of type.fields) { | ||
let name = field.localName; | ||
@@ -14,0 +13,0 @@ if (field.opt) |
@@ -304,3 +304,3 @@ import type { PbLong, PbULong } from "./pb-long"; | ||
* Used for fixed64, sfixed64, double. | ||
* Always 8 bytes. | ||
* Always 8 bytes with little-endian byte order. | ||
*/ | ||
@@ -328,3 +328,3 @@ Bit64 = 1, | ||
* Used for fixed32, sfixed32, float. | ||
* Always 4 bytes. | ||
* Always 4 bytes with little-endian byte order. | ||
*/ | ||
@@ -331,0 +331,0 @@ Bit32 = 5 |
@@ -1,2 +0,2 @@ | ||
import type { MessageInfo } from "./reflection-info"; | ||
import type { IMessageType } from './message-type-contract'; | ||
/** | ||
@@ -6,2 +6,2 @@ * Creates an instance of the generic message, using the field | ||
*/ | ||
export declare function reflectionCreate(info: MessageInfo): any; | ||
export declare function reflectionCreate<T extends object>(type: IMessageType<T>): T; |
{ | ||
"name": "@protobuf-ts/runtime", | ||
"version": "2.0.3", | ||
"version": "2.0.4-alpha.0", | ||
"description": "Runtime library for code generated by the protoc plugin \"protobuf-ts\"", | ||
@@ -40,3 +40,3 @@ "license": "(Apache-2.0 AND BSD-3-Clause)", | ||
}, | ||
"gitHead": "0f8b4e0b3a342b4c9eefc66c3568170096446a8f" | ||
"gitHead": "7053541f16529b5cc24287b13b57be0156c75bae" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
340082
8650
1