ts-proto 1.167.5 → 1.167.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +14 -8
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -288,7 +288,7 @@ function makeUtils(options) {
|
|
|
288
288
|
...makeTimestampMethods(options, longs, bytes),
|
|
289
289
|
...longs,
|
|
290
290
|
...makeComparisonUtils(),
|
|
291
|
-
...makeNiceGrpcServerStreamingMethodResult(),
|
|
291
|
+
...makeNiceGrpcServerStreamingMethodResult(options),
|
|
292
292
|
...makeGrpcWebErrorClass(bytes),
|
|
293
293
|
...makeExtensionClass(options),
|
|
294
294
|
...makeAssertionUtils(bytes),
|
|
@@ -424,7 +424,7 @@ function makeByteUtils(options) {
|
|
|
424
424
|
return base64FromBytesBrowserSnippet;
|
|
425
425
|
default:
|
|
426
426
|
return (0, ts_poet_1.code) `
|
|
427
|
-
if (${globalThis}.Buffer) {
|
|
427
|
+
if ((${globalThis} as any).Buffer) {
|
|
428
428
|
${base64FromBytesNodeSnippet}
|
|
429
429
|
} else {
|
|
430
430
|
${base64FromBytesBrowserSnippet}
|
|
@@ -621,12 +621,18 @@ function makeComparisonUtils() {
|
|
|
621
621
|
}`);
|
|
622
622
|
return { isObject, isSet };
|
|
623
623
|
}
|
|
624
|
-
function makeNiceGrpcServerStreamingMethodResult() {
|
|
625
|
-
const NiceGrpcServerStreamingMethodResult = (0, ts_poet_1.conditionalOutput)("ServerStreamingMethodResult",
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
624
|
+
function makeNiceGrpcServerStreamingMethodResult(options) {
|
|
625
|
+
const NiceGrpcServerStreamingMethodResult = (0, ts_poet_1.conditionalOutput)("ServerStreamingMethodResult", options.outputIndex
|
|
626
|
+
? (0, ts_poet_1.code) `
|
|
627
|
+
type ServerStreamingMethodResult<Response> = {
|
|
628
|
+
[Symbol.asyncIterator](): AsyncIterator<Response, void>;
|
|
629
|
+
};
|
|
630
|
+
`
|
|
631
|
+
: (0, ts_poet_1.code) `
|
|
632
|
+
export type ServerStreamingMethodResult<Response> = {
|
|
633
|
+
[Symbol.asyncIterator](): AsyncIterator<Response, void>;
|
|
634
|
+
};
|
|
635
|
+
`);
|
|
630
636
|
return { NiceGrpcServerStreamingMethodResult };
|
|
631
637
|
}
|
|
632
638
|
function makeGrpcWebErrorClass(bytes) {
|